This repository has been archived by the owner on Nov 27, 2024. It is now read-only.
generated from nix-community/nur-packages-template
-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
118 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
name: Test | ||
|
||
on: | ||
pull_request: | ||
push: | ||
branches: | ||
- master | ||
workflow_dispatch: | ||
|
||
env: | ||
NIX_CONFIG: "access-tokens = github.com=${{ secrets.GITHUB_TOKEN }}" | ||
|
||
jobs: | ||
test: | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
test: | ||
- custom-package | ||
os: | ||
- ubuntu-22.04 | ||
# - macos-11 | ||
|
||
runs-on: ${{ matrix.os }} | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
with: | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Install nix | ||
uses: cachix/install-nix-action@v26 | ||
|
||
- name: Setup cachix | ||
uses: cachix/cachix-action@v14 | ||
with: | ||
name: geonix | ||
authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}' | ||
|
||
- name: Run test | ||
run: bash ./test.sh | ||
working-directory: tests/${{ matrix.test }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
{ | ||
description = "Geospatial NIX"; | ||
|
||
nixConfig = { | ||
extra-substituters = [ | ||
"https://geonix.cachix.org" | ||
]; | ||
extra-trusted-public-keys = [ | ||
"geonix.cachix.org-1:iyhIXkDLYLXbMhL3X3qOLBtRF8HEyAbhPXjjPeYsCl0=" | ||
]; | ||
bash-prompt = "\\[\\033[1m\\][geonix]\\[\\033\[m\\]\\040\\w >\\040"; | ||
}; | ||
|
||
inputs = { | ||
geonix.url = "github:imincik/geospatial-nix"; | ||
nixpkgs.follows = "geonix/nixpkgs"; | ||
}; | ||
|
||
outputs = inputs@{ flake-parts, ... }: | ||
flake-parts.lib.mkFlake { inherit inputs; } { | ||
|
||
imports = [ | ||
# inputs.geoenv.flakeModule | ||
]; | ||
|
||
systems = [ "x86_64-linux" ]; | ||
|
||
perSystem = { config, self', inputs', pkgs, system, ... }: { | ||
packages = | ||
let | ||
geopkgs = inputs.geonix.lib.customizePackages { | ||
nixpkgs = pkgs; | ||
geopkgs = inputs.geonix.packages.${pkgs.system}; | ||
overridesFile = ./overrides.nix; | ||
}; | ||
in | ||
{ | ||
gdal = geopkgs.gdal; | ||
}; | ||
}; | ||
|
||
flake = { }; | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
--- a/overrides.nix | ||
+++ b/overrides.nix | ||
@@ -67,6 +67,12 @@ rec { | ||
|
||
# >>> CUSTOMIZE HERE | ||
|
||
+ version = "1000.0.0"; | ||
+ | ||
+ postPatch = '' | ||
+ substituteInPlace apps/gdalinfo_bin.cpp --replace "Usage: gdalinfo" "Usage: gdalinfo (patched)" | ||
+ ''; | ||
+ | ||
})).override { inherit geos libgeotiff libspatialite proj tiledb; useJava = false; }; | ||
_gdal = gdal; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
# overrides.nix file placeholder |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -euo pipefail | ||
|
||
|
||
cp ../../overrides.nix overrides.nix | ||
patch -u overrides.nix -i gdal.patch | ||
|
||
"$(nix build --accept-flake-config --no-link --print-out-paths .#gdal)"/bin/gdalinfo --help \ | ||
| grep "Usage: gdalinfo (patched)" |