Skip to content

Commit 6fb1c43

Browse files
committed
chore: create packages for newer fedora and ubuntu
1 parent ecfefac commit 6fb1c43

File tree

14 files changed

+220
-48
lines changed

14 files changed

+220
-48
lines changed

.github/images/arch-linux/PKGBUILD.in

+10-10
Original file line numberDiff line numberDiff line change
@@ -17,25 +17,25 @@ url="https://github.com/souffle-lang/souffle"
1717
license=('UPL')
1818
groups=()
1919
depends=('mcpp' 'gcc>=8' 'openmp' 'sqlite' 'python3')
20-
makedepends=('git' 'cmake>=3.15' 'bison>=3.0.4' 'flex' 'libffi' 'ncurses' 'zlib' 'python3')
20+
makedepends=('git' 'cmake>=3.15' 'bison>=3.6' 'flex' 'libffi' 'ncurses' 'zlib' 'python3')
2121
optdepends=('bash-completion')
2222
provides=('souffle')
2323
conflicts=('souffle-git')
2424
source=(souffle-${RELEASE_TAG}.tar.gz::https://github.com/${REPO_OWNER}/souffle/archive/${RELEASE_TAG}.tar.gz)
2525
md5sums=('SKIP')
2626

2727
build() {
28-
cd souffle-${pkgver}
29-
cmake -S . -B ./build \
30-
-DCMAKE_INSTALL_PREFIX=/usr \
31-
-DSOUFFLE_GIT=OFF \
32-
-DSOUFFLE_VERSION=${pkgver} \
33-
-DPACKAGE_VERSION=${pkgver} \
28+
cd souffle-${pkgver}
29+
cmake -S . -B ./build \
30+
-DCMAKE_INSTALL_PREFIX=/usr \
31+
-DSOUFFLE_GIT=OFF \
32+
-DPACKAGE_VERSION=${pkgver} \
33+
-DGIT_PACKAGE_VERSION=${pkgver}
3434

35-
cmake --build ./build --parallel "$(nproc)"
35+
cmake --build ./build --parallel "$(nproc)"
3636
}
3737

3838
package() {
39-
cd souffle-${pkgver}/build
40-
make DESTDIR="$pkgdir/" install
39+
cd souffle-${pkgver}/build
40+
make DESTDIR="$pkgdir/" install
4141
}

.github/images/entrypoint.sh

+7-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
#!/bin/sh
2+
set -euxo
23

34
# Run the build command
45
case "$DOMAIN_SIZE" in
@@ -11,6 +12,11 @@ case "$DOMAIN_SIZE" in
1112
;;
1213
esac
1314

14-
1515
# Create the package
1616
cmake --build ./build --parallel "$(nproc)" --target package
17+
18+
# Print version
19+
./build/src/souffle --version
20+
21+
# Run a few tests for consistency
22+
cmake --build ./build --target test -- ARGS="-R access1"

.github/images/fedora-40/Dockerfile

+30
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
FROM fedora:40
2+
3+
WORKDIR /souffle
4+
5+
# Install souffle build dependencies
6+
RUN dnf -y install \
7+
autoconf \
8+
automake \
9+
bash-completion \
10+
bison \
11+
cmake \
12+
doxygen \
13+
flex \
14+
gcc-c++ \
15+
git \
16+
libffi-devel \
17+
libtool \
18+
make \
19+
mcpp \
20+
ncurses-devel \
21+
pkg-config \
22+
python39 \
23+
rpm-build \
24+
sqlite-devel \
25+
zlib-devel
26+
27+
# Copy everything into souffle directory
28+
COPY . .
29+
30+
ENTRYPOINT ["/bin/bash", "-l", "-c", ".github/images/entrypoint.sh"]

.github/images/fedora-41/Dockerfile

+30
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
FROM fedora:41
2+
3+
WORKDIR /souffle
4+
5+
# Install souffle build dependencies
6+
RUN dnf -y install \
7+
autoconf \
8+
automake \
9+
bash-completion \
10+
bison \
11+
cmake \
12+
doxygen \
13+
flex \
14+
gcc-c++ \
15+
git \
16+
libffi-devel \
17+
libtool \
18+
make \
19+
mcpp \
20+
ncurses-devel \
21+
pkg-config \
22+
python39 \
23+
rpm-build \
24+
sqlite-devel \
25+
zlib-devel
26+
27+
# Copy everything into souffle directory
28+
COPY . .
29+
30+
ENTRYPOINT ["/bin/bash", "-l", "-c", ".github/images/entrypoint.sh"]
+32
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
FROM oraclelinux:9
2+
3+
WORKDIR /souffle
4+
5+
# Install souffle build dependencies
6+
RUN yum -y install dnf-plugins-core
7+
RUN dnf config-manager --set-enabled ol9_codeready_builder
8+
RUN dnf -y install \
9+
autoconf \
10+
automake \
11+
bash-completion \
12+
bison \
13+
clang \
14+
cmake \
15+
doxygen \
16+
flex \
17+
gcc-c++ \
18+
git \
19+
libffi-devel \
20+
libtool \
21+
make \
22+
ncurses-devel \
23+
pkg-config \
24+
python39 \
25+
rpm-build \
26+
sqlite-devel \
27+
zlib-devel
28+
29+
# Copy everything into souffle directory
30+
COPY . .
31+
32+
ENTRYPOINT ["/bin/bash", "-l", "-c", ".github/images/entrypoint.sh"]

.github/images/ubuntu-2204/Dockerfile

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
FROM ubuntu:22.04
2+
3+
ARG DEBIAN_FRONTEND=noninteractive
4+
WORKDIR /souffle
5+
6+
# Install souffle build dependencies
7+
RUN apt-get update && \
8+
apt-get install -y -q bash-completion bison build-essential clang debhelper default-jdk-headless devscripts doxygen fakeroot flex g++ gdb git graphviz libffi-dev libncurses5-dev libsqlite3-dev libtool make mcpp pkg-config python3-dev sqlite swig zlib1g-dev cmake ruby
9+
10+
# Copy everything into souffle directory
11+
COPY CMakeLists.txt ./CMakeLists.txt
12+
COPY cmake ./cmake
13+
COPY debian ./debian
14+
COPY man ./man
15+
COPY sh ./sh
16+
COPY src ./src
17+
COPY tests ./tests
18+
COPY utilities ./utilities
19+
COPY .github/images/entrypoint.sh ./entrypoint.sh
20+
COPY .git ./.git
21+
22+
ENTRYPOINT ["./entrypoint.sh"]

.github/images/ubuntu-2404/Dockerfile

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
FROM ubuntu:24.04
2+
3+
ARG DEBIAN_FRONTEND=noninteractive
4+
WORKDIR /souffle
5+
6+
# Install souffle build dependencies
7+
RUN apt-get update && \
8+
apt-get install -y -q bash-completion bison build-essential clang debhelper default-jdk-headless devscripts doxygen fakeroot flex g++ gdb git graphviz libffi-dev libncurses5-dev libsqlite3-dev libtool make mcpp pkg-config python3-dev sqlite3 swig zlib1g-dev cmake ruby
9+
10+
# Copy everything into souffle directory
11+
COPY CMakeLists.txt ./CMakeLists.txt
12+
COPY cmake ./cmake
13+
COPY debian ./debian
14+
COPY man ./man
15+
COPY sh ./sh
16+
COPY src ./src
17+
COPY tests ./tests
18+
COPY utilities ./utilities
19+
COPY .github/images/entrypoint.sh ./entrypoint.sh
20+
COPY .git ./.git
21+
22+
ENTRYPOINT ["./entrypoint.sh"]

.github/scripts/updatePPA.sh

+4-4
Original file line numberDiff line numberDiff line change
@@ -62,17 +62,17 @@ git add .
6262
git commit -m "Added fedora rpm files for $SOUFFLE_TAG"
6363

6464
## oraclelinux
65-
mkdir -p $TMPDIR/ppa/ol/8/x86_64
65+
mkdir -p $TMPDIR/ppa/ol/9/x86_64
6666
cd $TMPDIR/ppa/ol
6767

68-
for i in $DEBPATH/*oracle*8*/*rpm
68+
for i in $DEBPATH/*oracle*9*/*rpm
6969
do
7070
rpm --addsign $i
7171
done
7272

73-
cp $DEBPATH/*oracle*8*/*rpm 8/x86_64/
73+
cp $DEBPATH/*oracle*9*/*rpm 9/x86_64/
7474

75-
createrepo 8/x86_64
75+
createrepo 9/x86_64
7676

7777
git add .
7878
git commit -m "Added oraclelinux rpm files for $SOUFFLE_TAG"

.github/workflows/create-packages.yml

+23-14
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,24 @@ jobs:
99
fail-fast: false
1010
matrix:
1111
include:
12-
- release: ubuntu-2004
12+
- release: ubuntu-2204
1313
extension: ".deb"
14-
OS-name: "ubuntu/focal"
15-
- release: oraclelinux-8
14+
OS-name: "ubuntu/jammy"
15+
- release: ubuntu-2404
16+
extension: ".deb"
17+
OS-name: "ubuntu/noble"
18+
- release: oraclelinux-9
1619
extension: ".rpm"
17-
OS-name: "el/8"
20+
OS-name: "ol/9"
1821
- release: fedora-39
1922
extension: ".rpm"
2023
OS-name: "fedora/39"
24+
- release: fedora-40
25+
extension: ".rpm"
26+
OS-name: "fedora/40"
27+
- release: fedora-41
28+
extension: ".rpm"
29+
OS-name: "fedora/41"
2130

2231
runs-on: ubuntu-latest
2332
steps:
@@ -30,7 +39,7 @@ jobs:
3039
run: docker build . -f ./.github/images/${{ matrix.release }}/Dockerfile -t package_builder
3140

3241
- name: Packaging
33-
run: docker run -e DOMAIN_SIZE="64bit" --name container -t package_builder
42+
run: docker run -e DOMAIN_SIZE="64bit" --name container -t package_builder
3443

3544
- name: Extract
3645
id: extract_pkg
@@ -44,11 +53,11 @@ jobs:
4453
run: cp build/${{ steps.extract_pkg.outputs.pkg_name }} build/${{ steps.extract_pkg.outputs.artifact_name }}
4554

4655
- name: Upload Artifact
47-
uses: actions/upload-artifact@v3
56+
uses: actions/upload-artifact@v4
4857
with:
4958
name: ${{ steps.extract_pkg.outputs.artifact_name }}
5059
path: build/${{ steps.extract_pkg.outputs.artifact_name }}
51-
60+
5261
Arch-Package-Build:
5362
runs-on: ubuntu-latest
5463
steps:
@@ -60,14 +69,14 @@ jobs:
6069
- name: Prepare
6170
id: prepare
6271
run: |-
63-
echo "release_tag=$(git describe --tags --always | sed "s/-.*$//")" >> $GITHUB_OUTPUT
72+
echo "release_tag=$(git describe --tags --always | sed 's/-.*$//')" >> $GITHUB_OUTPUT
6473
6574
- name: Build Container
6675
run: docker build ./.github/images/arch-linux/ -t package_builder
6776

6877
- name: Packaging
6978
run: >
70-
docker run
79+
docker run
7180
-e RELEASE_TAG=${{ steps.prepare.outputs.release_tag }}
7281
-e REPO_OWNER=${{ github.repository_owner }}
7382
--name container
@@ -98,14 +107,14 @@ jobs:
98107
git push
99108
100109
101-
Upload-Release-Assests:
110+
Upload-Release-Assets:
102111
needs: CPack-Package-Build
103112
if: ${{ always() }}
104113

105114
runs-on: ubuntu-latest
106115
steps:
107116
- name: Download All Artifacts
108-
uses: actions/download-artifact@v3
117+
uses: actions/download-artifact@v4
109118
with:
110119
path: ./downloads
111120

@@ -116,8 +125,8 @@ jobs:
116125
cd result &&
117126
sha512sum * > sha512sum.txt
118127
119-
- name: Upload Release Assests
120-
uses: softprops/action-gh-release@v1
128+
- name: Upload Release Assets
129+
uses: softprops/action-gh-release@v2
121130
with:
122131
files: |
123132
result/*
@@ -135,7 +144,7 @@ jobs:
135144
clean: false
136145

137146
- name: Download All Artifacts
138-
uses: actions/download-artifact@v3
147+
uses: actions/download-artifact@v4
139148
with:
140149
path: ./downloads
141150

CMakeLists.txt

+24-14
Original file line numberDiff line numberDiff line change
@@ -14,39 +14,49 @@ include(CMakeDependentOption)
1414

1515
option(SOUFFLE_GIT "Enable/Disable git completion" ON)
1616

17-
if (SOUFFLE_GIT)
17+
if (SOUFFLE_GIT)
1818
find_package(Git REQUIRED)
1919

20-
# PACKAGE_VERSION is the full tag with git hash
20+
# GIT_TAGNAME identifies the current commit, it is closest tag in the
21+
# branch, possibly followed by number of additionnal commits and
22+
# abbreviated hash
2123
execute_process(COMMAND ${GIT_EXECUTABLE} describe --tags --always
2224
WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}"
2325
RESULT_VARIABLE GIT_RESULT
24-
OUTPUT_VARIABLE GIT_PACKAGE_VERSION)
25-
# FIXME: Use in cmake 3.19 or later
26-
# COMMAND_ERROR_IS_FATAL ANY)
26+
OUTPUT_VARIABLE GIT_TAGNAME)
27+
28+
# GIT_CLOSEST_TAG is the closest tag in the branch
29+
execute_process(COMMAND ${GIT_EXECUTABLE} describe --tags --always --abbrev=0
30+
WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}"
31+
RESULT_VARIABLE GIT_RESULT
32+
OUTPUT_VARIABLE GIT_CLOSEST_TAG)
2733

2834
# Figure out the version number, depends on whether building from the git repo
2935
if (NOT GIT_RESULT EQUAL 0)
3036
# Not building from a git clone
3137
message(WARNING "Unable to find git repository: version number will be incomplete")
32-
set(PACKAGE_VERSION "UNKNOWN")
33-
set(SOUFFLE_VERSION "")
38+
set(GIT_PACKAGE_VERSION "UNKNOWN")
39+
set(PACKAGE_VERSION "")
3440
else()
35-
string(REGEX REPLACE "\n$" "" PACKAGE_VERSION "${GIT_PACKAGE_VERSION}")
36-
message(STATUS "Building souffle version ${PACKAGE_VERSION}")
41+
string(REGEX REPLACE "\n$" "" GIT_PACKAGE_VERSION "${GIT_TAGNAME}")
42+
message(STATUS "Building souffle version ${GIT_PACKAGE_VERSION}")
3743

38-
# SOUFFLE_VERSION only includes the major/minor triplet
39-
string(REGEX REPLACE "-.*$" "" SOUFFLE_VERSION "${PACKAGE_VERSION}")
44+
string(REGEX REPLACE "\n$" "" GIT_CLOSEST_TAG "${GIT_CLOSEST_TAG}")
45+
# remove leading 'v' in tag if any
46+
string(REGEX REPLACE "^v" "" PACKAGE_VERSION "${GIT_CLOSEST_TAG}")
47+
# remove trailing '-something' in tag
48+
string(REGEX REPLACE "-.*$" "" PACKAGE_VERSION "${PACKAGE_VERSION}")
4049

4150
# If building from a shallow clone where tag is not available.
42-
if (NOT ${SOUFFLE_VERSION} MATCHES "^[0-9.]+$")
51+
if (NOT ${PACKAGE_VERSION} MATCHES "^[0-9.]+$")
4352
message(WARNING "Cannot find a valid tag: cmake project version will be incomplete")
44-
set (SOUFFLE_VERSION "")
4553
endif()
54+
55+
message(STATUS "Package version ${PACKAGE_VERSION}")
4656
endif()
4757
endif()
4858

49-
project(souffle VERSION "${SOUFFLE_VERSION}"
59+
project(souffle VERSION "${PACKAGE_VERSION}"
5060
DESCRIPTION "A datalog compiler"
5161
LANGUAGES CXX)
5262
include(CTest)

0 commit comments

Comments
 (0)