-
Notifications
You must be signed in to change notification settings - Fork 4
/
flake.nix
97 lines (92 loc) · 3.22 KB
/
flake.nix
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
{
description = "An image viewer for large image collections";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-23.05";
flake-utils.url = "github:numtide/flake-utils";
vidthumb.url = "github:grumbel/vidthumb";
vidthumb.inputs.nixpkgs.follows = "nixpkgs";
vidthumb.inputs.flake-utils.follows = "flake-utils";
};
outputs = { self, nixpkgs, flake-utils, vidthumb }:
flake-utils.lib.eachDefaultSystem (system:
let
# pkgs = nixpkgs.legacyPackages.${system};
pkgs = import nixpkgs {
inherit system;
config = { allowUnfree = true; };
};
in rec {
packages = rec {
default = galapix;
galapix = pkgs.ccacheStdenv.mkDerivation {
pname = "galapix";
version = "0.2.2";
src = nixpkgs.lib.cleanSource ./.;
enableParallelBuilding = true;
sconsFlags = [
"GALAPIX_SDL=True"
"GALAPIX_GTK=False"
];
preConfigure = ''
export CCACHE_DIR=/nix/var/cache/ccache
export CCACHE_UMASK=007
if [ ! -d "''${CCACHE_DIR}" ]; then
export CCACHE_DISABLE=1
fi
'';
installPhase = ''
mkdir -p $out/bin
cp build/galapix.sdl $out/bin/
'';
# Disabled due to insecure qtwebkit dependency
# --set GALAPIX_KOCONVERTER "${pkgs.calligra}/bin/koconverter"
postFixup = ''
wrapProgram $out/bin/galapix.sdl \
--prefix LIBGL_DRIVERS_PATH ":" "${pkgs.mesa.drivers}/lib/dri" \
--prefix LD_LIBRARY_PATH ":" "${pkgs.mesa.drivers}/lib" \
--set LIBGL_DRIVERS_PATH "${pkgs.mesa.drivers}/lib/dri" \
--set GALAPIX_RAR "${pkgs.rar}/bin/rar" \
--set GALAPIX_RSVG "${pkgs.librsvg}/bin/rsvg" \
--set GALAPIX_7ZR "${pkgs.p7zip}/bin/7zr" \
--set GALAPIX_TAR "${pkgs.gnutar}/bin/tar" \
--set GALAPIX_UFRAW_BATCH "${pkgs.nufraw}/bin/nufraw-batch" \
--set GALAPIX_VIDTHUMB "${vidthumb.packages.${system}.default}/bin/vidthumb" \
--set GALAPIX_XCFINFO "${pkgs.xcftools}/bin/xcfinfo" \
--set GALAPIX_XCF2PNG "${pkgs.xcftools}/bin/xcf2png" \
--set GALAPIX_UNZIP "${pkgs.unzip}/bin/unzip"
'';
nativeBuildInputs = with pkgs; [
scons
pkgconfig
makeWrapper
];
buildInputs = with pkgs; [
SDL2
SDL2_image
boost
curl
glew
imagemagick7
libGL
libGLU
libexif
libmhash
libspnav
sqlite
];
};
};
apps = rec {
galapix_sdl = flake-utils.lib.mkApp {
drv = packages.galapix;
exePath = "/bin/galapix.sdl";
};
galapix_gtk = flake-utils.lib.mkApp {
drv = packages.galapix;
exePath = "/bin/galapix.gtk";
};
default = galapix_sdl;
};
}
);
}