test
This commit is contained in:
parent
e4f6e95212
commit
b81d3528ad
134
flake.nix
134
flake.nix
@ -3,7 +3,6 @@
|
||||
inputs = {
|
||||
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
|
||||
flake-utils.url = "github:numtide/flake-utils";
|
||||
# Source du code GIMP
|
||||
gimp-source = {
|
||||
url = "git+https://gitlab.gnome.org/GNOME/gimp";
|
||||
flake = false;
|
||||
@ -13,7 +12,7 @@
|
||||
flake = false;
|
||||
};
|
||||
};
|
||||
outputs = { self, nixpkgs, flake-utils, gimp-source, ... }:
|
||||
outputs = { self, nixpkgs, flake-utils, gimp-source, gimp-data, ... }:
|
||||
flake-utils.lib.eachDefaultSystem (system:
|
||||
let
|
||||
pkgs = nixpkgs.legacyPackages.${system};
|
||||
@ -23,22 +22,37 @@
|
||||
pname = "gimp";
|
||||
version = "3.0.4";
|
||||
|
||||
src = gimp-source;
|
||||
src = pkgs.runCommand "merged-source" {} ''
|
||||
mkdir -p $out
|
||||
|
||||
# Copy first repo (main source)
|
||||
cp -r --no-preserve=mode ${gimp-source}/* $out/
|
||||
|
||||
mkdir -p $out/gimp-data
|
||||
cp -r --no-preserve=mode ${gimp-data}/* $out/gimp-data/
|
||||
|
||||
chmod -R +r $out
|
||||
chmod -R +w $out
|
||||
'';
|
||||
|
||||
nativeBuildInputs = with pkgs; [
|
||||
# Build tools
|
||||
git
|
||||
meson
|
||||
ninja
|
||||
pkg-config
|
||||
gettext
|
||||
python3Packages.pygobject3
|
||||
python3
|
||||
];
|
||||
|
||||
buildInputs = with pkgs; [
|
||||
#0
|
||||
meson
|
||||
#1
|
||||
pkg-config
|
||||
#2
|
||||
gettext
|
||||
#3
|
||||
babl
|
||||
gegl
|
||||
#4
|
||||
gtk4
|
||||
gtk3
|
||||
glib
|
||||
glib-networking
|
||||
gdk-pixbuf
|
||||
pango
|
||||
#5
|
||||
@ -60,18 +74,104 @@
|
||||
lcms
|
||||
#10
|
||||
libmypaint
|
||||
# Add your build dependencies
|
||||
# gcc
|
||||
# cmake
|
||||
# python3
|
||||
#11
|
||||
mypaint-brushes1
|
||||
#12
|
||||
libsoup_3
|
||||
python3Packages.pycairo
|
||||
glib-networking
|
||||
#13
|
||||
openjpeg
|
||||
libmng
|
||||
libwmf
|
||||
#14
|
||||
libheif
|
||||
libde265
|
||||
libaom
|
||||
openjpeg
|
||||
#15
|
||||
#??
|
||||
#21 (mandatory packages)
|
||||
appstream-glib
|
||||
atk
|
||||
fontconfig
|
||||
freetype
|
||||
gvfs
|
||||
json-glib
|
||||
libarchive
|
||||
libpng
|
||||
librsvg
|
||||
libtiff
|
||||
poppler
|
||||
poppler_data
|
||||
perl
|
||||
|
||||
# require only at build, not in install readme
|
||||
xorg.libXmu
|
||||
xorg.libXpm
|
||||
libxslt
|
||||
shared-mime-info
|
||||
|
||||
];
|
||||
|
||||
configurePhase = ''
|
||||
export HOME=$TMPDIR/home
|
||||
mkdir -p $HOME/.local/share
|
||||
mkdir -p $HOME/.config
|
||||
|
||||
export PKG_CONFIG_PATH="${pkgs.glib-networking}/lib/pkgconfig:${pkgs.glib}/lib/pkgconfig:$PKG_CONFIG_PATH"
|
||||
export GIO_MODULE_DIR="${pkgs.glib-networking}/lib/gio/modules"
|
||||
export FONTCONFIG_CACHE="$TMPDIR/fontconfig-cache"
|
||||
|
||||
export XDG_DATA_HOME=$HOME/.local/share
|
||||
export XDG_CONFIG_HOME=$HOME/.config
|
||||
export XDG_CACHE_HOME=$TMPDIR/cache
|
||||
mkdir -p "$XDG_CACHE_HOME/fontconfig"
|
||||
mkdir -p "$FONTCONFIG_CACHE"
|
||||
export GIMP_TESTING=1
|
||||
export G_MESSAGES_DEBUG=""
|
||||
export DISPLAY=""
|
||||
export WAYLAND_DISPLAY=""
|
||||
export XDG_RUNTIME_DIR=""
|
||||
|
||||
# Fontconfig setup
|
||||
export FONTCONFIG_FILE=${pkgs.fontconfig.out}/etc/fonts/fonts.conf
|
||||
|
||||
git init
|
||||
git remote add origin 'https://gitlab.gnome.org/GNOME/gimp'
|
||||
#git submodule update --init
|
||||
meson _build \
|
||||
--prefix=$out \
|
||||
--buildtype=release \
|
||||
-Dgi-docgen=disabled \
|
||||
-Dlua=false
|
||||
|
||||
# Fxing these fkingujjckjvnbnsdsc shebangs <3 claude.ai thx for help
|
||||
patchShebangs . || true
|
||||
patchShebangs _build/ || true
|
||||
|
||||
find . -type f -exec grep -l "#!/usr/bin/env" {} \; 2>/dev/null | while read file; do
|
||||
echo "Fixing shebang in: $file"
|
||||
sed -i 's|#!/usr/bin/env python3|#!${pkgs.python3}/bin/python3|g' "$file" || true
|
||||
sed -i 's|#!/usr/bin/env python|#!${pkgs.python3}/bin/python|g' "$file" || true
|
||||
sed -i 's|#!/usr/bin/env bash|#!${pkgs.bash}/bin/bash|g' "$file" || true
|
||||
sed -i 's|#!/usr/bin/env sh|#!${pkgs.bash}/bin/sh|g' "$file" || true
|
||||
sed -i 's|#!/usr/bin/env perl|#!${pkgs.perl}/bin/perl|g' "$file" || true
|
||||
done
|
||||
'';
|
||||
|
||||
buildPhase = ''
|
||||
meson compile
|
||||
export LD_LIBRARY_PATH="$PWD/_build/libgimp:$PWD/_build/libgimpbase:$PWD/_build/libgimpcolor:$PWD/_build/libgimpconfig:$PWD/_build/libgimpmath:$PWD/_build/libgimpmodule:$PWD/_build/libgimpthumb:$PWD/_build/libgimpwidgets:$LD_LIBRARY_PATH"
|
||||
ninja -C _build -v
|
||||
'';
|
||||
|
||||
installPhase = ''
|
||||
mkdir -p $out/bin
|
||||
#mkdir -p $out/bin
|
||||
echo "Installing GIMP..."
|
||||
ninja -C _build install
|
||||
|
||||
# Ensure the binary is executable
|
||||
chmod +x $out/bin/gimp-* || true
|
||||
# Install built files
|
||||
# make install PREFIX=$out
|
||||
# cp executable $out/bin/
|
||||
|
||||
Loading…
Reference in New Issue
Block a user