diff --git a/.github/workflows/CI.yaml b/.github/workflows/CI.yaml index c01782e1..761fb20b 100644 --- a/.github/workflows/CI.yaml +++ b/.github/workflows/CI.yaml @@ -24,7 +24,7 @@ jobs: - name: Cache uses: DeterminateSystems/magic-nix-cache-action@v4 - name: Build - run: nix build -L .#bundled + run: nix build -L .#all - name: Upload uses: actions/upload-artifact@v4 with: diff --git a/.github/workflows/Portable.yaml b/.github/workflows/Portable.yaml new file mode 100644 index 00000000..349f8e60 --- /dev/null +++ b/.github/workflows/Portable.yaml @@ -0,0 +1,28 @@ +name: Portable + +on: + - push + +jobs: + Build: + strategy: + fail-fast: false + matrix: + target: + - triple: x86_64-unknown-linux-gnu + runner: ubuntu-latest + runs-on: ${{ matrix.target.runner }} + steps: + - name: Checkout + uses: actions/checkout@v4 + - name: Nix + uses: DeterminateSystems/nix-installer-action@v10 + - name: Cache + uses: DeterminateSystems/magic-nix-cache-action@v4 + - name: Bundle + run: nix bundle --bundler github:DavHau/nix-portable -o bundle .#all + - name: Upload + uses: actions/upload-artifact@v4 + with: + name: d4-${{ matrix.target.triple }}-portable + path: bundle diff --git a/README.md b/README.md index ed12511a..ad3016e9 100644 --- a/README.md +++ b/README.md @@ -2,6 +2,15 @@ ## Installation +### Prebuilt + +There are prebuilt binaries available for each commit and release. +These binaries are bundled with their dependencies. +For details, see the README inside the release folder. + +On (Linux) systems with an older glibc, the normal variant might not work. +In this case, there is also the portable variant which is a self-extracting archive with everything bundled in one binary. + ### Nix This project can be used and developed via a [Nix][nix] [flake][flake]. diff --git a/doc/x86_64-linux-portable.md b/doc/x86_64-linux-portable.md new file mode 100644 index 00000000..c433943b --- /dev/null +++ b/doc/x86_64-linux-portable.md @@ -0,0 +1,30 @@ +# d4 + +This is a portable version of d4. +The project is licensed under the LGPL-2.1 and the source can be found at https://github.com/SoftVarE-Group/d4v2 + +## Dependencies + +In this version, all dependencies and the Nix package manager are bundled with d4 in a self-extracting archive. +Other than Git, there are no dependencies. +When Git is not found, the bundled Nix will fetch it automatically. + +The self-extracting archive is generated using https://github.com/DavHau/nix-portable and will create the directory `$HOME/.nix-portable`. +This can be overwritten by the `NP_LOCATION` environment variable which defaults to `$HOME`. + +## Usage + +The binary `d4` is inside `bin`. +To show the help message, use: + +``` +d4 --help +``` + +### d-DNNF compilation + +``` +d4 --input /path/to/input.cnf --method ddnnf-compiler --dump-ddnnf /path/to/output.ddnnf +``` + +... will take a CNF from `/path/to/input.cnf`, compile it into a d-DNNF and write it to `/path/to/output.ddnnf`. diff --git a/flake.nix b/flake.nix index 5fd741c3..36d9b671 100644 --- a/flake.nix +++ b/flake.nix @@ -103,8 +103,8 @@ }; }; - bundled-deps = pkgs.buildEnv { - name = "bundled-deps"; + dependencies = pkgs.buildEnv { + name = "dependencies"; paths = [ self.packages.${system}.mt-kahypar pkgs.hwloc.lib @@ -117,8 +117,8 @@ ]; }; - bundled-doc = pkgs.stdenv.mkDerivation { - name = "bundled-doc"; + documentation = pkgs.stdenv.mkDerivation { + name = "documentation"; src = ./doc; installPhase = '' mkdir $out @@ -126,12 +126,13 @@ ''; }; - bundled = pkgs.buildEnv { - name = "bundled"; + all = pkgs.buildEnv { + name = "d4"; + meta.mainProgram = "d4"; paths = [ self.packages.${system}.d4 - self.packages.${system}.bundled-deps - self.packages.${system}.bundled-doc + self.packages.${system}.dependencies + self.packages.${system}.documentation ]; }; };