Skip to content

Commit

Permalink
add a NixOS build script
Browse files Browse the repository at this point in the history
  • Loading branch information
krupkat committed Jul 10, 2023
1 parent 5dc79cf commit 749fecf
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 4 deletions.
16 changes: 12 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,14 @@ Xpano [<input files>] [--output=<path>] [--gui] [--help] [--version]

The project can be built by running a single script from the `misc/build` directory. You will need at least CMake 3.21, git and a compiler with C++20 support.

### NixOS

Run the build script from the root of the repository:

```
./misc/build/build-nixos.sh
```

### MacOS

Library prerequisites: SDL2, spdlog, catch2
Expand All @@ -52,7 +60,7 @@ Install with brew: `brew install sdl2 spdlog catch2`

Install with macports: `sudo port install libsdl2 spdlog catch2` (for details: [#96](https://github.com/krupkat/xpano/pull/96#issuecomment-1575589249))

Run the install script from the root of the repository:
Run the build script from the root of the repository:

```
./misc/build/build-macos-12.sh
Expand All @@ -68,7 +76,7 @@ Library prerequisites:
sudo apt install libgtk-3-dev libopencv-dev libsdl2-dev libspdlog-dev
```

Run the install script from the root of the repository:
Run the build script from the root of the repository:

```
./misc/build/build-ubuntu-22.sh
Expand All @@ -84,15 +92,15 @@ Library prerequisites:
sudo apt install libgtk-3-dev
```

Run the install script from the root of the repository:
Run the build script from the root of the repository:

```
./misc/build/build-ubuntu-20.sh
```

### Windows

Open the "Developer PowerShell for VS 2022" profile in Windows Terminal and run the install script from the root of the repository:
Open the "Developer PowerShell for VS 2022" profile in Windows Terminal and run the build script from the root of the repository:

```
./misc/build/build-windows-latest.ps1
Expand Down
30 changes: 30 additions & 0 deletions misc/build/build-nixos.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
#!/usr/bin/env nix-shell
#! nix-shell -i bash
#! nix-shell -p git cmake ninja pkg-config gcc13 opencv SDL2 gtk3 catch2_3 spdlog

git submodule update --init

export BUILD_TYPE='Release'
export EXIV2_VERSION='v0.28.0'

git clone https://github.com/Exiv2/exiv2.git --depth 1 --branch $EXIV2_VERSION
cd exiv2
cmake -B build -G Ninja \
-DCMAKE_BUILD_TYPE=$BUILD_TYPE \
-DCMAKE_INSTALL_PREFIX=install \
`cat ../misc/build/exiv2-minimal-flags.txt`
cmake --build build --target install
cd ..

cmake -B build -G Ninja \
-DCMAKE_BUILD_TYPE=$BUILD_TYPE \
-DCMAKE_INSTALL_PREFIX=install \
-DBUILD_TESTING=ON \
-DCMAKE_EXPORT_COMPILE_COMMANDS=ON \
-Dexiv2_DIR=exiv2/install/lib64/cmake/exiv2

cmake --build build --target install

cd build
ctest --output-on-failure
cd ..

0 comments on commit 749fecf

Please sign in to comment.