push sheeet
Some checks failed
Periodic Merges (6h) / master → staging-nixos (push) Failing after 12m50s
Periodic Merges (6h) / master → staging-next (push) Failing after 12m54s
Periodic Merges (24h) / merge-base(master,staging) → haskell-updates (push) Failing after 11m54s
Periodic Merges (6h) / staging-next → staging (push) Failing after 12m13s
Periodic Merges (24h) / staging-next-25.05 → staging-25.05 (push) Failing after 13m24s
Periodic Merges (24h) / release-25.05 → staging-next-25.05 (push) Failing after 14m28s

This commit is contained in:
Dark Steveneq
2025-10-09 14:15:47 +02:00
commit 646b892680
49168 changed files with 5897842 additions and 0 deletions

View File

@@ -0,0 +1,196 @@
{
lib,
stdenv,
fetchFromGitHub,
pkg-config,
libtool,
bzip2Support ? true,
bzip2,
zlibSupport ? true,
zlib,
libX11Support ? !stdenv.hostPlatform.isMinGW,
libX11,
libXtSupport ? !stdenv.hostPlatform.isMinGW,
libXt,
fontconfigSupport ? true,
fontconfig,
freetypeSupport ? true,
freetype,
ghostscriptSupport ? false,
ghostscript,
libjpegSupport ? true,
libjpeg,
djvulibreSupport ? true,
djvulibre,
lcms2Support ? true,
lcms2,
openexrSupport ? !stdenv.hostPlatform.isMinGW,
openexr,
libpngSupport ? true,
libpng,
liblqr1Support ? true,
liblqr1,
librsvgSupport ? !stdenv.hostPlatform.isMinGW,
librsvg,
libtiffSupport ? true,
libtiff,
libxml2Support ? true,
libxml2,
openjpegSupport ? !stdenv.hostPlatform.isMinGW,
openjpeg,
libwebpSupport ? !stdenv.hostPlatform.isMinGW,
libwebp,
libheifSupport ? true,
libheif,
libde265Support ? true,
libde265,
fftw,
testers,
}:
let
arch =
if stdenv.hostPlatform.system == "i686-linux" then
"i686"
else if
stdenv.hostPlatform.system == "x86_64-linux" || stdenv.hostPlatform.system == "x86_64-darwin"
then
"x86-64"
else if stdenv.hostPlatform.system == "armv7l-linux" then
"armv7l"
else if
stdenv.hostPlatform.system == "aarch64-linux" || stdenv.hostPlatform.system == "aarch64-darwin"
then
"aarch64"
else if stdenv.hostPlatform.system == "powerpc64le-linux" then
"ppc64le"
else
null;
in
stdenv.mkDerivation (finalAttrs: {
pname = "imagemagick";
version = "6.9.13-10";
src = fetchFromGitHub {
owner = "ImageMagick";
repo = "ImageMagick6";
rev = finalAttrs.version;
sha256 = "sha256-AdlJaCJOrN+NkkzzzgELtgAr5iZ9dvlVYVc7tYiM+R8=";
};
outputs = [
"out"
"dev"
"doc"
]; # bin/ isn't really big
outputMan = "out"; # it's tiny
enableParallelBuilding = true;
configureFlags = [
"--with-frozenpaths"
(lib.withFeatureAs (arch != null) "gcc-arch" arch)
(lib.withFeature librsvgSupport "rsvg")
(lib.withFeature liblqr1Support "lqr")
(lib.withFeatureAs ghostscriptSupport "gs-font-dir" "${ghostscript.fonts}/share/fonts")
(lib.withFeature ghostscriptSupport "gslib")
]
++ lib.optionals stdenv.hostPlatform.isMinGW [
# due to libxml2 being without DLLs ATM
"--enable-static"
"--disable-shared"
];
nativeBuildInputs = [
pkg-config
libtool
];
buildInputs =
[ ]
++ lib.optional zlibSupport zlib
++ lib.optional fontconfigSupport fontconfig
++ lib.optional ghostscriptSupport ghostscript
++ lib.optional liblqr1Support liblqr1
++ lib.optional libpngSupport libpng
++ lib.optional libtiffSupport libtiff
++ lib.optional libxml2Support libxml2
++ lib.optional libheifSupport libheif
++ lib.optional libde265Support libde265
++ lib.optional djvulibreSupport djvulibre
++ lib.optional openexrSupport openexr
++ lib.optional librsvgSupport librsvg
++ lib.optional openjpegSupport openjpeg;
propagatedBuildInputs = [
fftw
]
++ lib.optional bzip2Support bzip2
++ lib.optional freetypeSupport freetype
++ lib.optional libjpegSupport libjpeg
++ lib.optional lcms2Support lcms2
++ lib.optional libX11Support libX11
++ lib.optional libXtSupport libXt
++ lib.optional libwebpSupport libwebp;
doCheck = false; # fails 2 out of 76 tests
postInstall = ''
(cd "$dev/include" && ln -s ImageMagick* ImageMagick)
moveToOutput "bin/*-config" "$dev"
moveToOutput "lib/ImageMagick-*/config-Q16" "$dev" # includes configure params
for file in "$dev"/bin/*-config; do
substituteInPlace "$file" --replace "${pkg-config}/bin/pkg-config -config" \
${pkg-config}/bin/${pkg-config.targetPrefix}pkg-config
substituteInPlace "$file" --replace ${pkg-config}/bin/pkg-config \
"PKG_CONFIG_PATH='$dev/lib/pkgconfig' '${pkg-config}/bin/${pkg-config.targetPrefix}pkg-config'"
done
''
+ lib.optionalString ghostscriptSupport ''
for la in $out/lib/*.la; do
sed 's|-lgs|-L${lib.getLib ghostscript}/lib -lgs|' -i $la
done
'';
passthru.tests.pkg-config = testers.testMetaPkgConfig finalAttrs.finalPackage;
meta = with lib; {
homepage = "https://legacy.imagemagick.org/";
changelog = "https://legacy.imagemagick.org/script/changelog.php";
description = "Software suite to create, edit, compose, or convert bitmap images";
pkgConfigModules = [
"ImageMagick"
"MagickWand"
];
platforms = platforms.linux ++ platforms.darwin;
maintainers = [ ];
license = licenses.asl20;
knownVulnerabilities = [
"CVE-2019-13136"
"CVE-2019-17547"
"CVE-2020-25663"
"CVE-2020-27768"
"CVE-2020-27769"
"CVE-2020-27829"
"CVE-2021-20243"
"CVE-2021-20244"
"CVE-2021-20310"
"CVE-2021-20311"
"CVE-2021-20312"
"CVE-2021-20313"
"CVE-2021-3596"
"CVE-2022-0284"
"CVE-2022-2719"
"CVE-2023-1289"
"CVE-2023-2157"
"CVE-2023-34151"
"CVE-2023-34152"
"CVE-2023-34153"
"CVE-2023-3428"
"CVE-2023-34474"
"CVE-2023-34475"
"CVE-2023-5341"
];
};
})

View File

@@ -0,0 +1,214 @@
{
lib,
stdenv,
fetchFromGitHub,
pkg-config,
libtool,
bzip2Support ? true,
bzip2,
zlibSupport ? true,
zlib,
libX11Support ? !stdenv.hostPlatform.isMinGW,
libX11,
libXtSupport ? !stdenv.hostPlatform.isMinGW,
libXt,
fontconfigSupport ? true,
fontconfig,
freetypeSupport ? true,
freetype,
ghostscriptSupport ? false,
ghostscript,
libjpegSupport ? true,
libjpeg,
djvulibreSupport ? true,
djvulibre,
lcms2Support ? true,
lcms2,
openexrSupport ? !stdenv.hostPlatform.isMinGW,
openexr,
libjxlSupport ? true,
libjxl,
libpngSupport ? true,
libpng,
liblqr1Support ? true,
liblqr1,
libraqmSupport ? true,
libraqm,
librawSupport ? true,
libraw,
librsvgSupport ? !stdenv.hostPlatform.isMinGW,
librsvg,
pango,
libtiffSupport ? true,
libtiff,
libxml2Support ? true,
libxml2,
openjpegSupport ? !stdenv.hostPlatform.isMinGW,
openjpeg,
libwebpSupport ? !stdenv.hostPlatform.isMinGW,
libwebp,
libheifSupport ? true,
libheif,
fftwSupport ? true,
fftw,
potrace,
coreutils,
curl,
testers,
nixos-icons,
perlPackages,
python3,
}:
assert libXtSupport -> libX11Support;
assert libraqmSupport -> freetypeSupport;
let
arch =
if stdenv.hostPlatform.system == "i686-linux" then
"i686"
else if
stdenv.hostPlatform.system == "x86_64-linux" || stdenv.hostPlatform.system == "x86_64-darwin"
then
"x86-64"
else if stdenv.hostPlatform.system == "armv7l-linux" then
"armv7l"
else if
stdenv.hostPlatform.system == "aarch64-linux" || stdenv.hostPlatform.system == "aarch64-darwin"
then
"aarch64"
else if stdenv.hostPlatform.system == "powerpc64le-linux" then
"ppc64le"
else
null;
in
stdenv.mkDerivation (finalAttrs: {
pname = "imagemagick";
version = "7.1.2-5";
src = fetchFromGitHub {
owner = "ImageMagick";
repo = "ImageMagick";
tag = finalAttrs.version;
hash = "sha256-THStvhNWu4OYotzxksGJ6l6VeTVRNoJeKoRG1LaJhNI=";
};
outputs = [
"out"
"dev"
"doc"
]; # bin/ isn't really big
outputMan = "out"; # it's tiny
enableParallelBuilding = true;
configureFlags = [
# specify delegates explicitly otherwise `convert` will invoke the build
# coreutils for filetypes it doesn't natively support.
"MVDelegate=${lib.getExe' coreutils "mv"}"
"RMDelegate=${lib.getExe' coreutils "rm"}"
"--with-frozenpaths"
(lib.withFeatureAs (arch != null) "gcc-arch" arch)
(lib.withFeature librsvgSupport "rsvg")
(lib.withFeature librsvgSupport "pango")
(lib.withFeature liblqr1Support "lqr")
(lib.withFeature libjxlSupport "jxl")
(lib.withFeatureAs ghostscriptSupport "gs-font-dir" "${ghostscript.fonts}/share/fonts")
(lib.withFeature ghostscriptSupport "gslib")
(lib.withFeature fftwSupport "fftw")
]
++ lib.optionals stdenv.hostPlatform.isMinGW [
# due to libxml2 being without DLLs ATM
"--enable-static"
"--disable-shared"
];
nativeBuildInputs = [
pkg-config
libtool
];
buildInputs = [
potrace
]
++ lib.optional zlibSupport zlib
++ lib.optional fontconfigSupport fontconfig
++ lib.optional ghostscriptSupport ghostscript
++ lib.optional liblqr1Support liblqr1
++ lib.optional libpngSupport libpng
++ lib.optional libraqmSupport libraqm
++ lib.optional librawSupport libraw
++ lib.optional libtiffSupport libtiff
++ lib.optional libxml2Support libxml2
++ lib.optional libheifSupport libheif
++ lib.optional djvulibreSupport djvulibre
++ lib.optional libjxlSupport libjxl
++ lib.optional openexrSupport openexr
++ lib.optionals librsvgSupport [
librsvg
pango
]
++ lib.optional openjpegSupport openjpeg;
propagatedBuildInputs = [
curl
]
++ lib.optional bzip2Support bzip2
++ lib.optional freetypeSupport freetype
++ lib.optional libjpegSupport libjpeg
++ lib.optional lcms2Support lcms2
++ lib.optional libX11Support libX11
++ lib.optional libXtSupport libXt
++ lib.optional libwebpSupport libwebp
++ lib.optional fftwSupport fftw;
postInstall = ''
(cd "$dev/include" && ln -s ImageMagick* ImageMagick)
# Q16HDRI = 16 bit quantum depth with HDRI support, and is the default ImageMagick configuration
# If the default is changed, or the derivation is modified to use a different configuration
# this will need to be changed below.
moveToOutput "bin/*-config" "$dev"
moveToOutput "lib/ImageMagick-*/config-Q16HDRI" "$dev" # includes configure params
configDestination=($out/share/ImageMagick-*)
grep -v '/nix/store' $dev/lib/ImageMagick-*/config-Q16HDRI/configure.xml > $configDestination/configure.xml
for file in "$dev"/bin/*-config; do
substituteInPlace "$file" --replace pkg-config \
"PKG_CONFIG_PATH='$dev/lib/pkgconfig' '$(command -v $PKG_CONFIG)'"
done
''
+ lib.optionalString ghostscriptSupport ''
for la in $out/lib/*.la; do
sed 's|-lgs|-L${lib.getLib ghostscript}/lib -lgs|' -i $la
done
'';
passthru.tests = {
version = testers.testVersion { package = finalAttrs.finalPackage; };
inherit nixos-icons;
inherit (perlPackages) ImageMagick;
inherit (python3.pkgs) img2pdf willow;
pkg-config = testers.hasPkgConfigModules {
package = finalAttrs.finalPackage;
version = lib.head (lib.splitString "-" finalAttrs.version);
};
};
meta = with lib; {
homepage = "http://www.imagemagick.org/";
changelog = "https://github.com/ImageMagick/Website/blob/main/ChangeLog.md";
description = "Software suite to create, edit, compose, or convert bitmap images";
pkgConfigModules = [
"ImageMagick"
"MagickWand"
];
platforms = platforms.unix;
maintainers = with maintainers; [
dotlambda
rhendric
faukah
];
license = licenses.asl20;
mainProgram = "magick";
};
})

View File

@@ -0,0 +1,106 @@
{
lib,
stdenv,
fetchFromGitHub,
cmake,
pkg-config,
libX11,
procps,
python3,
libdwarf,
qtbase,
wrapQtAppsHook,
libglvnd,
gtest,
brotli,
enableGui ? true,
}:
stdenv.mkDerivation rec {
pname = "apitrace";
version = "13.0";
src = fetchFromGitHub {
owner = "apitrace";
repo = "apitrace";
rev = version;
hash = "sha256-ZZ2RL9nvwvHBEuKSDr1tgRhxBeg+XJKPUvSiHz6g/cg=";
fetchSubmodules = true;
};
# LD_PRELOAD wrappers need to be statically linked to work against all kinds
# of games -- so it's fine to use e.g. bundled snappy.
buildInputs = [
libX11
procps
libdwarf
gtest
brotli
]
++ lib.optionals enableGui [
qtbase
];
nativeBuildInputs = [
cmake
pkg-config
python3
]
++ lib.optionals enableGui [
wrapQtAppsHook
];
cmakeFlags = [
(lib.cmakeBool "ENABLE_GUI" enableGui)
];
# Don't automatically wrap all binaries, I prefer to explicitly only wrap
# `qapitrace`.
dontWrapQtApps = true;
postFixup = ''
# Since https://github.com/NixOS/nixpkgs/pull/60985, we add `/run-opengl-driver[-32]`
# to the `RUNPATH` of dispatcher libraries `dlopen()` ing OpenGL drivers.
# `RUNPATH` doesn't propagate throughout the whole application, but only
# from the module performing the `dlopen()`.
#
# Apitrace wraps programs by running them with `LD_PRELOAD` pointing to `.so`
# files in $out/lib/apitrace/wrappers.
#
# Theses wrappers effectively wrap the `dlopen()` calls from `libglvnd`
# and other dispatcher libraries, and run `dlopen()` by themselves.
#
# As `RUNPATH` doesn't propagate through the whole library, and they're now the
# library doing the real `dlopen()`, they also need to have
# `/run-opengl-driver[-32]` added to their `RUNPATH`.
#
# To stay simple, we add paths for 32 and 64 bits unconditionally.
# This doesn't have an impact on closure size, and if the 32 bit drivers
# are not available, that folder is ignored.
for i in $out/lib/apitrace/wrappers/*.so
do
echo "Patching OpenGL driver path for $i"
patchelf --set-rpath "/run/opengl-driver/lib:/run/opengl-driver-32/lib:$(patchelf --print-rpath $i)" $i
done
# Theses open the OpenGL driver at runtime, but it is not listed as NEEDED libraries. They need
# a reference to libglvnd.
for i in $out/bin/eglretrace $out/bin/glretrace
do
echo "Patching RPath for $i"
patchelf --set-rpath "${lib.makeLibraryPath [ libglvnd ]}:$(patchelf --print-rpath $i)" $i
done
''
+ lib.optionalString enableGui ''
wrapQtApp $out/bin/qapitrace
'';
meta = with lib; {
homepage = "https://apitrace.github.io";
description = "Tools to trace OpenGL, OpenGL ES, Direct3D, and DirectDraw APIs";
license = licenses.mit;
platforms = platforms.linux;
};
}

View File

@@ -0,0 +1,47 @@
{
lib,
stdenv,
fetchzip,
libpng,
zlib,
zopfli,
}:
stdenv.mkDerivation rec {
pname = "apngasm";
version = "2.91";
src = fetchzip {
url = "mirror://sourceforge/${pname}/${pname}-${version}-src.zip";
stripRoot = false;
sha256 = "0qhljqql159xkn1l83vz0q8wvzr7rjz4jnhiy0zn36pgvacg0zn1";
};
buildInputs = [
libpng
zlib
zopfli
];
postPatch = ''
rm -rf libpng zlib zopfli
'';
NIX_CFLAGS_LINK = "-lzopfli";
installPhase = ''
install -Dt $out/bin apngasm
'';
enableParallelBuilding = true;
meta = with lib; {
description = "Create highly optimized Animated PNG files from PNG/TGA images";
mainProgram = "apngasm";
homepage = "https://apngasm.sourceforge.net/";
license = licenses.zlib;
maintainers = with maintainers; [ orivej ];
platforms = platforms.linux;
};
}

View File

@@ -0,0 +1,48 @@
{
lib,
stdenv,
fetchFromGitHub,
fetchpatch,
cmake,
boost,
libpng,
zlib,
}:
stdenv.mkDerivation {
pname = "apngasm";
version = "3.1.10";
src = fetchFromGitHub {
owner = "apngasm";
repo = "apngasm";
rev = "f105b2d6024ef3113bb407d68e27e476a17fa998";
sha256 = "sha256-lTk2sTllKHRUaWPPEkC4qU5K10oRaLrdWBgN4MUGKeo=";
};
patches = [
# Fix parallel build and avoid static linking of binary.
(fetchpatch {
url = "https://gitweb.gentoo.org/repo/gentoo.git/plain/media-gfx/apngasm/files/apngasm-3.1.10-static.patch?id=45fd0cde71ca2ae0e7e38ab67400d84b86b593d7";
sha256 = "sha256-eKthgInWxXEqN5PupvVf9wVQDElxsPYRFXT7pMc6vIU=";
})
];
nativeBuildInputs = [ cmake ];
buildInputs = [
boost
libpng
zlib
];
meta = with lib; {
description = "Create an APNG from multiple PNG files";
homepage = "https://github.com/apngasm/apngasm";
license = licenses.zlib;
maintainers = with maintainers; [ orivej ];
platforms = platforms.linux;
mainProgram = "apngasm";
};
}

View File

@@ -0,0 +1,86 @@
{
mkDerivation,
lib,
fetchgit,
qtbase,
qmake,
qtscript,
flex,
bison,
qtdeclarative,
}:
let
version = "5.1";
src = fetchgit {
url = "https://github.com/kmkolasinski/AwesomeBump.git";
rev = "Winx32v${version}";
sha256 = "1c8b9jki0v8kzkvsvyv7q1w3s7j40br6ph15hh2xi0a1mpwckq56";
fetchSubmodules = true;
};
qtnproperty = mkDerivation {
name = "qtnproperty";
inherit src;
sourceRoot = "${src.name}/Sources/utils/QtnProperty";
patches = [ ./qtnproperty-parallel-building.patch ];
buildInputs = [
qtscript
qtbase
qtdeclarative
];
nativeBuildInputs = [
qmake
flex
bison
];
postInstall = ''
install -D bin-linux/QtnPEG $out/bin/QtnPEG
'';
};
in
mkDerivation {
pname = "awesomebump";
inherit version;
inherit src;
buildInputs = [
qtbase
qtscript
qtdeclarative
];
nativeBuildInputs = [ qmake ];
preBuild = ''
ln -sf ${qtnproperty}/bin/QtnPEG Sources/utils/QtnProperty/bin-linux/QtnPEG
'';
dontWrapQtApps = true;
postInstall = ''
d=$out/libexec/AwesomeBump
mkdir -p $d
cp -vr workdir/`cat workdir/current`/bin/AwesomeBump $d/
cp -prd Bin/Configs Bin/Core $d/
# AwesomeBump expects to find Core and Configs in its current directory.
makeQtWrapper $d/AwesomeBump $out/bin/AwesomeBump \
--chdir "$d"
'';
# $ cd Sources; qmake; make ../workdir/linux-g++-dgb-gl4/obj/glwidget.o
# fatal error: properties/ImageProperties.peg.h: No such file or directory
enableParallelBuilding = false;
meta = {
homepage = "https://github.com/kmkolasinski/AwesomeBump";
description = "Program to generate normal, height, specular or ambient occlusion textures from a single image";
license = lib.licenses.gpl3Plus;
maintainers = [ ];
platforms = lib.platforms.linux;
mainProgram = "AwesomeBump";
};
}

View File

@@ -0,0 +1,9 @@
--- a/PEG/Flex.pri
+++ b/PEG/Flex.pri
@@ -1,5 +1,6 @@
flex.name = Flex ${QMAKE_FILE_IN}
flex.input = FLEX_SOURCES
+flex.depends = ${QMAKE_FILE_PATH}/${QMAKE_FILE_BASE}.parser.cpp
flex.output = ${QMAKE_FILE_PATH}/${QMAKE_FILE_BASE}.lexer.cpp
win32:flex.commands = win_flex --wincompat -o ${QMAKE_FILE_PATH}/${QMAKE_FILE_BASE}.lexer.cpp ${QMAKE_FILE_IN}

View File

@@ -0,0 +1,145 @@
{
lib,
stdenv,
fetchFromGitHub,
fetchYarnDeps,
makeDesktopItem,
copyDesktopItems,
fixup-yarn-lock,
makeWrapper,
autoSignDarwinBinariesHook,
nodejs,
yarn,
electron,
}:
stdenv.mkDerivation rec {
pname = "drawio";
version = "26.1.1";
src = fetchFromGitHub {
owner = "jgraph";
repo = "drawio-desktop";
rev = "v${version}";
fetchSubmodules = true;
hash = "sha256-h9APkOtH7s31r89hqqH12zYqkVMrR2ZxMyc+Zwq21+A=";
};
# `@electron/fuses` tries to run `codesign` and fails. Disable and use autoSignDarwinBinariesHook instead
postPatch = ''
sed -i -e 's/resetAdHocDarwinSignature:.*/resetAdHocDarwinSignature: false,/' build/fuses.cjs
'';
offlineCache = fetchYarnDeps {
yarnLock = src + "/yarn.lock";
hash = "sha256-kmA0z/vmWH+yD2OQ6VVSE0yPxInTAGjjG+QfcoZHlQ0=";
};
nativeBuildInputs = [
fixup-yarn-lock
makeWrapper
nodejs
yarn
]
++ lib.optionals (!stdenv.hostPlatform.isDarwin) [
copyDesktopItems
]
++ lib.optionals stdenv.hostPlatform.isDarwin [
autoSignDarwinBinariesHook
];
ELECTRON_SKIP_BINARY_DOWNLOAD = true;
configurePhase = ''
runHook preConfigure
export HOME="$TMPDIR"
yarn config --offline set yarn-offline-mirror "$offlineCache"
fixup-yarn-lock yarn.lock
# Ensure that the node_modules folder is created by yarn install.
# See https://github.com/yarnpkg/yarn/issues/5500#issuecomment-1221456246
echo "nodeLinker: node-modules" > .yarnrc.yml
yarn install --offline --frozen-lockfile --ignore-platform --ignore-scripts --no-progress --non-interactive
patchShebangs node_modules/
runHook postConfigure
'';
buildPhase = ''
runHook preBuild
''
+ lib.optionalString stdenv.hostPlatform.isDarwin ''
cp -R ${electron.dist}/Electron.app Electron.app
chmod -R u+w Electron.app
export CSC_IDENTITY_AUTO_DISCOVERY=false
sed -i "/afterSign/d" electron-builder-linux-mac.json
''
+ ''
yarn --offline run electron-builder --dir \
${lib.optionalString stdenv.hostPlatform.isDarwin "--config electron-builder-linux-mac.json"} \
-c.electronDist=${if stdenv.hostPlatform.isDarwin then "." else electron.dist} \
-c.electronVersion=${electron.version}
runHook postBuild
'';
installPhase = ''
runHook preInstall
''
+ lib.optionalString stdenv.hostPlatform.isDarwin ''
mkdir -p $out/{Applications,bin}
mv dist/mac*/draw.io.app $out/Applications
# Symlinking `draw.io` doesn't work; seems to look for files in the wrong place.
makeWrapper $out/Applications/draw.io.app/Contents/MacOS/draw.io $out/bin/drawio
''
+ lib.optionalString (!stdenv.hostPlatform.isDarwin) ''
mkdir -p "$out/share/lib/drawio"
cp -r dist/*-unpacked/{locales,resources{,.pak}} "$out/share/lib/drawio"
install -Dm644 build/icon.svg "$out/share/icons/hicolor/scalable/apps/drawio.svg"
makeWrapper '${electron}/bin/electron' "$out/bin/drawio" \
--add-flags "$out/share/lib/drawio/resources/app.asar" \
--add-flags "\''${NIXOS_OZONE_WL:+\''${WAYLAND_DISPLAY:+--ozone-platform-hint=auto --enable-features=WaylandWindowDecorations --enable-wayland-ime=true}}" \
--inherit-argv0
''
+ ''
runHook postInstall
'';
desktopItems = [
(makeDesktopItem {
name = "drawio";
exec = "drawio %U";
icon = "drawio";
desktopName = "drawio";
comment = "draw.io desktop";
mimeTypes = [
"application/vnd.jgraph.mxfile"
"application/vnd.visio"
];
categories = [ "Graphics" ];
startupWMClass = "draw.io";
})
];
meta = {
description = "Desktop version of draw.io for creating diagrams";
homepage = "https://about.draw.io/";
license = with lib.licenses; [
# The LICENSE file of https://github.com/jgraph/drawio claims Apache License Version 2.0 again since https://github.com/jgraph/drawio/commit/5b2e73471e4fea83d681f0cec5d1aaf7c3884996
asl20
# But the README says:
# The minified code authored by us in this repo is licensed under an Apache v2 license, but the sources to build those files are not in this repo. This is not an open source project.
unfreeRedistributable
];
changelog = "https://github.com/jgraph/drawio-desktop/releases/tag/v${version}";
maintainers = with lib.maintainers; [ darkonion0 ];
platforms = lib.platforms.darwin ++ lib.platforms.linux;
mainProgram = "drawio";
};
}

View File

@@ -0,0 +1,46 @@
{
lib,
writeTextFile,
runtimeShell,
drawio,
xvfb-run,
}:
writeTextFile {
name = "${drawio.pname}-headless-${drawio.version}";
executable = true;
destination = "/bin/drawio";
text = ''
#!${runtimeShell}
# Electron really wants a configuration directory to not die with:
# "Error: Failed to get 'appData' path"
# so we give it some temp dir as XDG_CONFIG_HOME
tmpdir=$(mktemp -d)
function cleanup {
rm -rf "$tmpdir"
}
trap cleanup EXIT
# Drawio needs to run in a virtual X session, because Electron
# refuses to work and dies with an unhelpful error message otherwise:
# "The futex facility returned an unexpected error code."
XDG_CONFIG_HOME="$tmpdir" ${xvfb-run}/bin/xvfb-run --auto-display ${drawio}/bin/drawio $@
'';
meta = with lib; {
description = "xvfb wrapper around drawio";
longDescription = ''
A wrapper around drawio (draw.io) for running in headless environments.
Runs drawio under xvfb-run, with configuration going to a temporary
directory.
'';
maintainers = with maintainers; [
qyliss
tfc
];
mainProgram = "drawio";
};
}

View File

@@ -0,0 +1,226 @@
{
stdenv,
lib,
fetchurl,
replaceVars,
autoreconfHook,
pkg-config,
intltool,
babl,
gegl,
gtk2,
glib,
gdk-pixbuf,
isocodes,
pango,
cairo,
freetype,
fontconfig,
lcms,
libpng,
libjpeg,
libjxl,
poppler,
poppler_data,
libtiff,
libmng,
librsvg,
libwmf,
zlib,
libzip,
xz,
ghostscript,
aalib,
shared-mime-info,
libexif,
gettext,
makeWrapper,
gtk-doc,
xorg,
glib-networking,
libmypaint,
gexiv2,
harfbuzz,
mypaint-brushes1,
libwebp,
libheif,
libxslt,
libgudev,
openexr,
desktopToDarwinBundle,
gtk-mac-integration-gtk2,
withPython ? false,
python2,
}:
let
python = python2.withPackages (pp: [ pp.pygtk ]);
in
stdenv.mkDerivation (finalAttrs: {
pname = "gimp";
version = "2.10.38";
outputs = [
"out"
"dev"
];
src = fetchurl {
url = "http://download.gimp.org/pub/gimp/v${lib.versions.majorMinor finalAttrs.version}/gimp-${finalAttrs.version}.tar.bz2";
sha256 = "sha256-UKhF7sEciDH+hmFweVD1uERuNfMO37ms+Y+FwRM/hW4=";
};
patches = [
# to remove compiler from the runtime closure, reference was retained via
# gimp --version --verbose output
(replaceVars ./remove-cc-reference.patch {
cc_version = stdenv.cc.cc.name;
})
# Use absolute paths instead of relying on PATH
# to make sure plug-ins are loaded by the correct interpreter.
./hardcode-plugin-interpreters.patch
# GIMP queries libheif.pc for builtin encoder/decoder support to determine if AVIF/HEIC files are supported
# (see https://gitlab.gnome.org/GNOME/gimp/-/blob/a8b1173ca441283971ee48f4778e2ffd1cca7284/configure.ac?page=2#L1846-1852)
# These variables have been removed since libheif 1.18.0
# (see https://github.com/strukturag/libheif/commit/cf0d89c6e0809427427583290547a7757428cf5a)
# This has already been fixed for the upcoming GIMP 3, but the fix has not been backported to 2.x yet
# (see https://gitlab.gnome.org/GNOME/gimp/-/issues/9080)
./force-enable-libheif.patch
];
# error: possibly undefined macro: AM_NLS
preAutoreconf = ''
cp ${gettext}/share/gettext/m4/nls.m4 m4macros
'';
nativeBuildInputs = [
autoreconfHook # hardcode-plugin-interpreters.patch changes Makefile.am
pkg-config
intltool
gettext
makeWrapper
gtk-doc
libxslt
]
++ lib.optionals stdenv.hostPlatform.isDarwin [
desktopToDarwinBundle
];
buildInputs = [
babl
gegl
gtk2
glib
gdk-pixbuf
pango
cairo
gexiv2
harfbuzz
isocodes
freetype
fontconfig
lcms
libpng
libjpeg
libjxl
poppler
poppler_data
libtiff
openexr
libmng
librsvg
libwmf
zlib
libzip
xz
ghostscript
aalib
shared-mime-info
libwebp
libheif
libexif
xorg.libXpm
glib-networking
libmypaint
mypaint-brushes1
]
++ lib.optionals stdenv.hostPlatform.isDarwin [
gtk-mac-integration-gtk2
]
++ lib.optionals stdenv.hostPlatform.isLinux [
libgudev
]
++ lib.optionals withPython [
python
# Duplicated here because python.withPackages does not expose the dev output with pkg-config files
python2.pkgs.pygtk
];
# needed by gimp-2.0.pc
propagatedBuildInputs = [
gegl
];
configureFlags = [
"--without-webkit" # old version is required
"--disable-check-update"
"--with-bug-report-url=https://github.com/NixOS/nixpkgs/issues/new"
"--with-icc-directory=/run/current-system/sw/share/color/icc"
# fix libdir in pc files (${exec_prefix} needs to be passed verbatim)
"--libdir=\${exec_prefix}/lib"
]
++ lib.optionals (!withPython) [
"--disable-python" # depends on Python2 which was EOLed on 2020-01-01
];
enableParallelBuilding = true;
doCheck = true;
env = {
NIX_CFLAGS_COMPILE = toString (
[ ]
++ lib.optionals stdenv.cc.isGNU [ "-Wno-error=incompatible-pointer-types" ]
++ lib.optionals stdenv.hostPlatform.isDarwin [ "-DGDK_OSX_BIG_SUR=16" ]
);
# Check if librsvg was built with --disable-pixbuf-loader.
PKG_CONFIG_GDK_PIXBUF_2_0_GDK_PIXBUF_MODULEDIR = "${librsvg}/${gdk-pixbuf.moduleDir}";
};
preConfigure = ''
# The check runs before glib-networking is registered
export GIO_EXTRA_MODULES="${glib-networking}/lib/gio/modules:$GIO_EXTRA_MODULES"
'';
postFixup = ''
wrapProgram $out/bin/gimp-${lib.versions.majorMinor finalAttrs.version} \
--set GDK_PIXBUF_MODULE_FILE "$GDK_PIXBUF_MODULE_FILE"
'';
passthru = {
# The declarations for `gimp-with-plugins` wrapper,
# used for determining plug-in installation paths
majorVersion = "${lib.versions.major finalAttrs.version}.0";
targetLibDir = "lib/gimp/${finalAttrs.passthru.majorVersion}";
targetDataDir = "share/gimp/${finalAttrs.passthru.majorVersion}";
targetPluginDir = "${finalAttrs.passthru.targetLibDir}/plug-ins";
targetScriptDir = "${finalAttrs.passthru.targetDataDir}/scripts";
# probably its a good idea to use the same gtk in plugins ?
gtk = gtk2;
python2Support = withPython;
};
meta = with lib; {
description = "GNU Image Manipulation Program";
homepage = "https://www.gimp.org/";
maintainers = [ ];
license = licenses.gpl3Plus;
platforms = platforms.unix;
mainProgram = "gimp";
};
})

View File

@@ -0,0 +1,22 @@
diff --git a/configure.ac b/configure.ac
index 48c3c77892..3189781817 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1843,13 +1843,13 @@ can_export_heic=no
can_import_avif=no
can_export_avif=no
if test "x$have_libheif" = xyes; then
- can_import_heic=`$PKG_CONFIG --variable=builtin_h265_decoder libheif`
- can_export_heic=`$PKG_CONFIG --variable=builtin_h265_encoder libheif`
+ can_import_heic=yes
+ can_export_heic=yes
if test "x$can_import_heic" = xyes; then
MIME_TYPES="$MIME_TYPES;image/heif;image/heic"
fi
- can_import_avif=`$PKG_CONFIG --variable=builtin_avif_decoder libheif`
- can_export_avif=`$PKG_CONFIG --variable=builtin_avif_encoder libheif`
+ can_import_avif=yes
+ can_export_avif=yes
if test "x$can_import_avif" = xyes; then
MIME_TYPES="$MIME_TYPES;image/avif"
fi

View File

@@ -0,0 +1,11 @@
--- a/plug-ins/pygimp/Makefile.am
+++ b/plug-ins/pygimp/Makefile.am
@@ -157,7 +157,7 @@ install-interp-file:
echo 'python=$(PYBIN_PATH)' > '$(DESTDIR)$(pyinterpfile)'
echo 'python2=$(PYBIN_PATH)' >> '$(DESTDIR)$(pyinterpfile)'
echo '/usr/bin/python=$(PYBIN_PATH)' >> '$(DESTDIR)$(pyinterpfile)'
- echo ":Python:E::py::`basename $(PYTHON)`:" >> '$(DESTDIR)$(pyinterpfile)'
+ echo ":Python:E::py::$(PYTHON):" >> '$(DESTDIR)$(pyinterpfile)'
install-data-local: install-env-file install-interp-file

View File

@@ -0,0 +1,13 @@
diff --git a/app/gimp-version.c b/app/gimp-version.c
index 3d1894a036..48bb670b64 100644
--- a/app/gimp-version.c
+++ b/app/gimp-version.c
@@ -230,7 +230,7 @@ gimp_version (gboolean be_verbose,
GIMP_BUILD_ID,
gimp_version_get_revision (),
GIMP_BUILD_PLATFORM_FAMILY,
- CC_VERSION,
+ "@cc_version@",
lib_versions);
g_free (lib_versions);

View File

@@ -0,0 +1,333 @@
{
stdenv,
lib,
fetchurl,
replaceVars,
meson,
ninja,
pkg-config,
babl,
cfitsio,
gegl,
gtk3,
glib,
gdk-pixbuf,
graphviz,
isocodes,
pango,
cairo,
libarchive,
luajit,
freetype,
fontconfig,
lcms,
libpng,
libiff,
libilbm,
libjpeg,
libjxl,
poppler,
poppler_data,
libtiff,
libmng,
librsvg,
libwmf,
zlib,
xz,
libzip,
ghostscript,
aalib,
shared-mime-info,
python3,
libexif,
gettext,
wrapGAppsHook3,
libxslt,
gobject-introspection,
vala,
gi-docgen,
perl,
appstream-glib,
desktop-file-utils,
xorg,
glib-networking,
json-glib,
libmypaint,
llvmPackages,
gexiv2,
harfbuzz,
mypaint-brushes1,
libwebp,
libheif,
gjs,
libgudev,
openexr,
xvfb-run,
dbus,
adwaita-icon-theme,
alsa-lib,
desktopToDarwinBundle,
fetchpatch,
}:
let
python = python3.withPackages (
pp: with pp; [
pygobject3
]
);
in
stdenv.mkDerivation (finalAttrs: {
pname = "gimp";
version = "3.0.4";
outputs = [
"out"
"dev"
"devdoc"
];
src = fetchurl {
url = "https://download.gimp.org/gimp/v${lib.versions.majorMinor finalAttrs.version}/gimp-${finalAttrs.version}.tar.xz";
hash = "sha256-jKouwnW/CTJldWVKwnavwIP4SR58ykXRnPKeaWrsqyU=";
};
patches = [
# to remove compiler from the runtime closure, reference was retained via
# gimp --version --verbose output
(replaceVars ./remove-cc-reference.patch {
cc_version = stdenv.cc.cc.name;
})
# Use absolute paths instead of relying on PATH
# to make sure plug-ins are loaded by the correct interpreter.
# TODO: This now only appears to be used on Windows.
(replaceVars ./hardcode-plugin-interpreters.patch {
python_interpreter = python.interpreter;
PYTHON_EXE = null;
})
# D-Bus configuration is not available in the build sandbox
# so we need to pick up the one from the package.
(replaceVars ./tests-dbus-conf.patch {
session_conf = "${dbus.out}/share/dbus-1/session.conf";
})
# Fix a crash that occurs when trying to pick a color for text outline
# TODO: remove after GIMP 3.2 is released, per https://gitlab.gnome.org/GNOME/gimp/-/issues/14047#note_2491655
(fetchpatch {
url = "https://gitlab.gnome.org/GNOME/gimp/-/commit/1685c86af5d6253151d0056a9677ba469ea10164.diff";
hash = "sha256-Rb3ANXWki21thByEIWkBgWEml4x9Qq2HAIB9ho1bygw=";
})
];
nativeBuildInputs = [
meson
ninja
pkg-config
gettext
wrapGAppsHook3
libxslt # for xsltproc
gobject-introspection
perl
vala
# for docs
gi-docgen
# for tests
desktop-file-utils
]
++ lib.optionals stdenv.hostPlatform.isLinux [
dbus
xvfb-run
]
++ lib.optionals stdenv.hostPlatform.isDarwin [
desktopToDarwinBundle
];
buildInputs = [
appstream-glib # for library
babl
cfitsio
gegl
gtk3
glib
gdk-pixbuf
pango
cairo
libarchive
gexiv2
harfbuzz
isocodes
freetype
fontconfig
lcms
libpng
libiff
libilbm
libjpeg
libjxl
poppler
poppler_data
libtiff
openexr
libmng
librsvg
libwmf
zlib
xz
libzip
ghostscript
aalib
shared-mime-info
json-glib
libwebp
libheif
python
libexif
xorg.libXpm
xorg.libXmu
glib-networking
libmypaint
mypaint-brushes1
# New file dialogue crashes with “Icon 'image-missing' not present in theme Symbolic” without an icon theme.
adwaita-icon-theme
# for Lua plug-ins
(luajit.withPackages (pp: [
pp.lgi
]))
]
++ lib.optionals stdenv.hostPlatform.isLinux [
alsa-lib
# for JavaScript plug-ins
gjs
]
++ lib.optionals stdenv.hostPlatform.isDarwin [
llvmPackages.openmp
]
++ lib.optionals stdenv.hostPlatform.isLinux [
libgudev
];
propagatedBuildInputs = [
# needed by gimp-3.0.pc
gegl
cairo
pango
gexiv2
];
mesonFlags = [
"-Dbug-report-url=https://github.com/NixOS/nixpkgs/issues/new"
"-Dicc-directory=/run/current-system/sw/share/color/icc"
"-Dcheck-update=no"
(lib.mesonEnable "gudev" stdenv.hostPlatform.isLinux)
(lib.mesonEnable "headless-tests" stdenv.hostPlatform.isLinux)
(lib.mesonEnable "linux-input" stdenv.hostPlatform.isLinux)
# Not very important to do downstream, save a dependency.
"-Dappdata-test=disabled"
]
++ lib.optionals stdenv.hostPlatform.isDarwin [
"-Dalsa=disabled"
"-Djavascript=disabled"
];
doCheck = true;
env = {
# The check runs before glib-networking is registered
GIO_EXTRA_MODULES = "${glib-networking}/lib/gio/modules";
NIX_CFLAGS_COMPILE = lib.optionalString stdenv.hostPlatform.isDarwin "-DGDK_OSX_BIG_SUR=16";
# Check if librsvg was built with --disable-pixbuf-loader.
PKG_CONFIG_GDK_PIXBUF_2_0_GDK_PIXBUF_MODULEDIR = "${librsvg}/${gdk-pixbuf.moduleDir}";
};
postPatch = ''
patchShebangs tools/gimp-mkenums
# GIMP is executed at build time so we need to fix this.
# TODO: Look into if we can fix the interp thing.
chmod +x plug-ins/python/{colorxhtml,file-openraster,foggify,gradients-save-as-css,histogram-export,palette-offset,palette-sort,palette-to-gradient,python-eval,spyro-plus}.py
patchShebangs \
plug-ins/python/{colorxhtml,file-openraster,foggify,gradients-save-as-css,histogram-export,palette-offset,palette-sort,palette-to-gradient,python-eval,spyro-plus}.py
'';
preBuild =
let
librarySuffix =
if stdenv.hostPlatform.extensions.library == ".so" then
"3.0.so.0"
else if stdenv.hostPlatform.extensions.library == ".dylib" then
"3.0.0.dylib"
else
throw "Unsupported library extension ${stdenv.hostPlatform.extensions.library}";
in
''
# Our gobject-introspection patches make the shared library paths absolute
# in the GIR files. When running GIMP in build or check phase, it will try
# to use plug-ins, which import GIMP introspection files which will try
# to load the GIMP libraries which will not be installed yet.
# So we need to replace the absolute path with a local one.
# We are using a symlink that will be overridden during installation.
mkdir -p "$out/lib"
ln -s "$PWD/libgimp/libgimp-${librarySuffix}" \
"$PWD/libgimpbase/libgimpbase-${librarySuffix}" \
"$PWD/libgimpcolor/libgimpcolor-${librarySuffix}" \
"$PWD/libgimpconfig/libgimpconfig-${librarySuffix}" \
"$PWD/libgimpmath/libgimpmath-${librarySuffix}" \
"$PWD/libgimpmodule/libgimpmodule-${librarySuffix}" \
"$out/lib/"
'';
preCheck = ''
# Avoid Error retrieving accessibility bus address
export NO_AT_BRIDGE=1
# Fix storing recent file list in tests
export HOME="$TMPDIR"
export XDG_DATA_DIRS="${glib.getSchemaDataDirPath gtk3}:${adwaita-icon-theme}/share:$XDG_DATA_DIRS"
'';
preFixup = ''
gappsWrapperArgs+=(--prefix PATH : "${
lib.makeBinPath [
# for dot for gegl:introspect (Debug » Show Image Graph, hidden by default on stable release)
graphviz
# for gimp-script-fu-interpreter-3.0 invoked by shebang of some plug-ins
"$out"
]
}")
'';
postFixup = ''
# Cannot be in postInstall, otherwise _multioutDocs hook in preFixup will move right back.
moveToOutput "share/doc" "$devdoc"
'';
passthru = {
# The declarations for `gimp-with-plugins` wrapper,
# used for determining plug-in installation paths
majorVersion = "${lib.versions.major finalAttrs.version}.0";
targetLibDir = "lib/gimp/${finalAttrs.passthru.majorVersion}";
targetDataDir = "share/gimp/${finalAttrs.passthru.majorVersion}";
targetPluginDir = "${finalAttrs.passthru.targetLibDir}/plug-ins";
targetScriptDir = "${finalAttrs.passthru.targetDataDir}/scripts";
# probably its a good idea to use the same gtk in plugins ?
gtk = gtk3;
};
meta = with lib; {
description = "GNU Image Manipulation Program";
homepage = "https://www.gimp.org/";
maintainers = with maintainers; [ jtojnar ];
license = licenses.gpl3Plus;
platforms = platforms.linux;
mainProgram = "gimp";
};
})

View File

@@ -0,0 +1,8 @@
--- a/plug-ins/python/pygimp.interp.in
+++ b/plug-ins/python/pygimp.interp.in
@@ -2,4 +2,4 @@ python=@PYTHON_EXE@
python3=@PYTHON_EXE@
/usr/bin/python=@PYTHON_EXE@
/usr/bin/python3=@PYTHON_EXE@
-:Python:E::py::python3:
+:Python:E::py::@python_interpreter@:

View File

@@ -0,0 +1,383 @@
# Use `gimp-with-plugins` package for GIMP with all plug-ins.
# If you just want a subset of plug-ins, you can specify them explicitly:
# `gimp-with-plugins.override { plugins = with gimpPlugins; [ gap ]; }`.
{
lib,
pkgs,
gimp,
}:
let
inherit (pkgs)
stdenv
fetchurl
fetchpatch
fetchpatch2
pkg-config
intltool
glib
fetchFromGitHub
fetchFromGitLab
;
# We cannot use gimp from the arguments directly, or it would be shadowed by the one
# from scope when initializing the scope with it, leading to infinite recursion.
gimpArg = gimp;
in
lib.makeScope pkgs.newScope (
self:
let
# Use GIMP from the scope.
inherit (self) gimp;
pluginDerivation =
attrs:
let
name = attrs.name or "${attrs.pname}-${attrs.version}";
pkgConfigMajorVersion = lib.versions.major gimp.version;
in
stdenv.mkDerivation (
{
prePhases = [ "extraLib" ];
extraLib = ''
installScripts(){
mkdir -p $out/${gimp.targetScriptDir}/${name};
for p in "$@"; do cp "$p" -r $out/${gimp.targetScriptDir}/${name}; done
}
installPlugin() {
# The base name of the first argument is the plug-in name and the main executable.
# GIMP only allows a single plug-in per directory:
# https://gitlab.gnome.org/GNOME/gimp/-/commit/efae55a73e98389e38fa0e59ebebcda0abe3ee96
pluginDir=$out/${gimp.targetPluginDir}/$(basename "$1")
install -Dt "$pluginDir" "$@"
}
'';
}
// attrs
// {
name = "${gimp.pname}-plugin-${name}";
buildInputs = [
gimp
gimp.gtk
glib
]
++ (attrs.buildInputs or [ ]);
nativeBuildInputs = [
pkg-config
intltool
]
++ (attrs.nativeBuildInputs or [ ]);
# Override installation paths.
env = {
"PKG_CONFIG_GIMP_${pkgConfigMajorVersion}_0_GIMPLIBDIR" =
"${placeholder "out"}/${gimp.targetLibDir}";
"PKG_CONFIG_GIMP_${pkgConfigMajorVersion}_0_GIMPDATADIR" =
"${placeholder "out"}/${gimp.targetDataDir}";
}
// attrs.env or { };
}
);
scriptDerivation =
{ src, ... }@attrs:
pluginDerivation (
{
prePhases = [ "extraLib" ];
dontUnpack = true;
installPhase = ''
runHook preInstall
installScripts ${src}
runHook postInstall
'';
}
// attrs
);
in
{
# Allow overriding GIMP package in the scope.
gimp = gimpArg;
bimp = pluginDerivation rec {
/*
menu:
File/Batch Image Manipulation...
*/
pname = "bimp";
version = "2.6";
src = fetchFromGitHub {
owner = "alessandrofrancesconi";
repo = "gimp-plugin-bimp";
rev = "v${version}";
hash = "sha256-IJ3+/9UwxJTRo0hUdzlOndOHwso1wGv7Q4UuhbsFkco=";
};
patches = [
# Allow overriding installation path
# https://github.com/alessandrofrancesconi/gimp-plugin-bimp/pull/311
(fetchpatch {
url = "https://github.com/alessandrofrancesconi/gimp-plugin-bimp/commit/098edb5f70a151a3f377478fd6e0d08ed56b8ef7.patch";
sha256 = "2Afx9fmdn6ztbsll2f2j7mfffMWYWyr4BuBy9ySV6vM=";
})
];
postPatch = ''
substituteInPlace Makefile \
--replace-fail "gcc" "${stdenv.cc.targetPrefix}cc"
'';
nativeBuildInputs = with pkgs; [ which ];
# workaround for issue:
# https://github.com/alessandrofrancesconi/gimp-plugin-bimp/issues/411
env.NIX_CFLAGS_COMPILE = "-Wno-error=incompatible-pointer-types";
installFlags = [
"SYSTEM_INSTALL_DIR=${placeholder "out"}/${gimp.targetPluginDir}/bimp"
];
installTargets = [ "install-admin" ];
meta = with lib; {
broken = gimp.majorVersion != "2.0";
description = "Batch Image Manipulation Plugin for GIMP";
homepage = "https://github.com/alessandrofrancesconi/gimp-plugin-bimp";
license = licenses.gpl2Plus;
maintainers = [ ];
};
};
farbfeld = pluginDerivation {
pname = "farbfeld";
version = "unstable-2019-08-12";
src = fetchFromGitHub {
owner = "ids1024";
repo = "gimp-farbfeld";
rev = "5feacebf61448bd3c550dda03cd08130fddc5af4";
sha256 = "1vmw7k773vrndmfffj0m503digdjmkpcqy2r3p3i5x0qw9vkkkc6";
};
installPhase = ''
installPlugin farbfeld
'';
meta = {
broken = gimp.majorVersion != "2.0";
description = "Gimp plug-in for the farbfeld image format";
homepage = "https://github.com/ids1024/gimp-farbfeld";
license = lib.licenses.mit;
maintainers = with lib.maintainers; [ sikmir ];
};
};
fourier = pluginDerivation rec {
/*
menu:
Filters/Generic/FFT Forward
Filters/Generic/FFT Inverse
*/
pname = "fourier";
version = "0.4.3";
src = fetchurl {
url = "https://www.lprp.fr/files/old-web/soft/gimp/${pname}-${version}.tar.gz";
sha256 = "0mf7f8vaqs2madx832x3kcxw3hv3w3wampvzvaps1mkf2kvrjbsn";
};
buildInputs = with pkgs; [ fftw ];
postPatch = ''
substituteInPlace Makefile --replace '$(GCC)' '$(CC)'
# The tarball contains a prebuilt binary.
make clean
'';
installPhase = ''
runHook preInstall
installPlugin fourier
runHook postInstall
'';
meta = with lib; {
broken = gimp.majorVersion != "2.0";
description = "GIMP plug-in to do the fourier transform";
homepage = "https://people.via.ecp.fr/~remi/soft/gimp/gimp_plugin_en.php3#fourier";
license = with licenses; [ gpl3Plus ];
};
};
resynthesizer = pluginDerivation rec {
/*
menu:
Edit/Fill with pattern seamless...
Filters/Enhance/Heal selection...
Filters/Enhance/Heal transparency...
Filters/Enhance/Sharpen by synthesis...
Filters/Enhance/Uncrop...
Filters/Map/Style...
Filters/Render/Texture...
*/
pname = "resynthesizer";
version = "2.0.3";
buildInputs = with pkgs; [ fftw ];
nativeBuildInputs = with pkgs; [ autoreconfHook ];
makeFlags = [ "GIMP_LIBDIR=${placeholder "out"}/${gimp.targetLibDir}" ];
src = fetchFromGitHub {
owner = "bootchk";
repo = "resynthesizer";
rev = "v${version}";
sha256 = "1jwc8bhhm21xhrgw56nzbma6fwg59gc8anlmyns7jdiw83y0zx3j";
};
meta = {
broken = gimp.majorVersion != "2.0";
};
};
texturize = pluginDerivation {
pname = "texturize";
version = "2.2+unstable=2021-12-03";
src = fetchFromGitHub {
owner = "lmanul";
repo = "gimp-texturize";
rev = "9ceff0d411cda018108e5477320669b8d00d811e";
sha256 = "haYS0K3oAPlHtHB8phOCX5/gtWq9uiVQhG5ZhAFX0t0=";
};
nativeBuildInputs = with pkgs; [
meson
ninja
gettext
];
meta = {
broken = gimp.majorVersion != "2.0";
};
};
waveletSharpen = pluginDerivation {
/*
menu:
Filters/Enhance/Wavelet sharpen
*/
pname = "wavelet-sharpen";
version = "0.1.2";
src = fetchurl {
url = "https://github.com/pixlsus/registry.gimp.org_static/raw/master/registry.gimp.org/files/wavelet-sharpen-0.1.2.tar.gz";
sha256 = "0vql1k67i21g5ivaa1jh56rg427m0icrkpryrhg75nscpirfxxqw";
};
env = {
# Workaround build failure on -fno-common toolchains like upstream
# gcc-10. Otherwise build fails as:
# ld: interface.o:(.bss+0xe0): multiple definition of `fimg'; plugin.o:(.bss+0x40): first defined here
NIX_CFLAGS_COMPILE = "-fcommon";
NIX_LDFLAGS = "-lm";
};
installPhase = "installPlugin src/wavelet-sharpen"; # TODO translations are not copied .. How to do this on nix?
meta = {
broken = gimp.majorVersion != "2.0";
};
};
lqrPlugin = pluginDerivation rec {
/*
menu:
Layer/Liquid Rescale
*/
pname = "lqr-plugin";
version = "0.7.2";
buildInputs = with pkgs; [ liblqr1 ];
src = fetchFromGitHub {
owner = "carlobaldassi";
repo = "gimp-lqr-plugin";
rev = "v${version}";
sha256 = "81ajdZ2zQi/THxnBlSeT36tVTEzrS1YqLGpHMhFTKAo=";
};
patches = [
# Pull upstream fix for -fno-common toolchain support:
# https://github.com/carlobaldassi/gimp-lqr-plugin/pull/6
(fetchpatch {
name = "fno-common.patch";
url = "https://github.com/carlobaldassi/gimp-lqr-plugin/commit/ae3464a82e1395fc577cc94999bdc7c4a7bb35f1.patch";
sha256 = "EdjZWM6U1bhUmsOnLA8iJ4SFKuAXHIfNPzxZqel+JrY=";
})
];
meta = {
broken = gimp.majorVersion != "2.0";
};
};
gmic = pkgs.gmic-qt.override {
variant = "gimp";
inherit (self) gimp;
};
gimplensfun = pluginDerivation {
version = "unstable-2018-10-21";
pname = "gimplensfun";
src = fetchFromGitHub {
owner = "seebk";
repo = "GIMP-Lensfun";
rev = "1c5a5c1534b5faf098b7441f8840d22835592f17";
sha256 = "1jj3n7spkjc63aipwdqsvq9gi07w13bb1v8iqzvxwzld2kxa3c8w";
};
buildInputs = (
with pkgs;
[
lensfun
gexiv2
]
++ lib.optional stdenv.cc.isClang llvmPackages.openmp
);
installPhase = "
installPlugin gimp-lensfun
";
meta = {
broken = gimp.majorVersion != "2.0";
description = "GIMP plugin to correct lens distortion using the lensfun library and database";
homepage = "http://lensfun.sebastiankraft.net/";
license = lib.licenses.gpl3Plus;
maintainers = [ ];
};
};
# =============== simple script files ====================
# also have a look at enblend-enfuse in all-packages.nix
exposureBlend = scriptDerivation {
name = "exposure-blend";
src = fetchurl {
url = "http://tir.astro.utoledo.edu/jdsmith/code/eb/exposure-blend.scm";
sha256 = "1b6c9wzpklqras4wwsyw3y3jp6fjmhnnskqiwm5sabs8djknfxla";
};
meta.broken = true;
};
lightning = scriptDerivation {
name = "Lightning";
src = fetchurl {
url = "https://github.com/pixlsus/registry.gimp.org_static/raw/master/registry.gimp.org/files/Lightning.scm";
sha256 = "c14a8f4f709695ede3f77348728a25b3f3ded420da60f3f8de3944b7eae98a49";
};
};
}
)

View File

@@ -0,0 +1,13 @@
diff --git a/app/gimp-version.c b/app/gimp-version.c
index 6e311c8252..e6fd9d1d78 100644
--- a/app/gimp-version.c
+++ b/app/gimp-version.c
@@ -90,7 +90,7 @@ gimp_version (gboolean be_verbose,
GIMP_BUILD_ID,
gimp_version_get_revision (),
GIMP_BUILD_PLATFORM_FAMILY,
- CC_VERSION,
+ "@cc_version@",
lib_versions);
g_free (lib_versions);

View File

@@ -0,0 +1,11 @@
--- a/build/meson/run_test_env.sh
+++ b/build/meson/run_test_env.sh
@@ -33,7 +33,7 @@ if [ -n "${UI_TEST}" ]; then
OPT="--auto-servernum"
fi
xvfb-run $OPT --server-args="-screen 0 1280x1024x24" \
- dbus-run-session -- "$@"
+ dbus-run-session --config-file="@session_conf@" -- "$@"
else
# Run the executable directly,

View File

@@ -0,0 +1,47 @@
{
lib,
symlinkJoin,
makeWrapper,
gimpPlugins,
gnome-themes-extra,
plugins ? null,
}:
let
inherit (gimpPlugins) gimp;
allPlugins = lib.filter (pkg: lib.isDerivation pkg && !pkg.meta.broken or false) (
lib.attrValues gimpPlugins
);
selectedPlugins = lib.filter (pkg: pkg != gimp) (if plugins == null then allPlugins else plugins);
extraArgs =
map (x: x.wrapArgs or "") selectedPlugins
++ lib.optionals (gimp.majorVersion == "2.0") [
''--prefix GTK_PATH : "${gnome-themes-extra}/lib/gtk-2.0"''
];
exeVersion =
if gimp.majorVersion == "2.0" then lib.versions.majorMinor gimp.version else gimp.majorVersion;
majorVersion = lib.versions.major gimp.version;
in
symlinkJoin {
name = "gimp-with-plugins-${gimp.version}";
paths = [ gimp ] ++ selectedPlugins;
nativeBuildInputs = [ makeWrapper ];
postBuild = ''
for each in gimp-${exeVersion} gimp-console-${exeVersion}; do
wrapProgram $out/bin/$each \
--set GIMP${majorVersion}_PLUGINDIR "$out/${gimp.targetLibDir}" \
--set GIMP${majorVersion}_DATADIR "$out/${gimp.targetDataDir}" \
${toString extraArgs}
done
set +x
for each in gimp gimp-console; do
ln -sf "$each-${exeVersion}" $out/bin/$each
done
'';
inherit (gimp) meta;
}

View File

@@ -0,0 +1,101 @@
{
lib,
stdenv,
cmake,
fetchurl,
gnumake,
makeWrapper,
pkg-config,
boost,
cairo,
enblend-enfuse,
exiv2,
fftw,
flann,
gettext,
glew,
lcms2,
lensfun,
libjpeg,
libpng,
libtiff,
libX11,
libXi,
libXmu,
libGLU,
libGL,
openexr,
panotools,
perlPackages,
sqlite,
vigra,
wrapGAppsHook3,
wxGTK,
zlib,
}:
stdenv.mkDerivation rec {
pname = "hugin";
version = "2024.0.1";
src = fetchurl {
url = "mirror://sourceforge/hugin/hugin-${version}.tar.bz2";
hash = "sha256-E+wM3utOtjFJyDN2jT43Tnz1pqjY0C1QiFzklvBbp+Q=";
};
buildInputs = [
boost
cairo
exiv2
fftw
flann
gettext
glew
lcms2
lensfun
libjpeg
libpng
libtiff
libX11
libXi
libXmu
libGLU
libGL
openexr
panotools
sqlite
vigra
wxGTK
zlib
];
nativeBuildInputs = [
cmake
makeWrapper
pkg-config
wrapGAppsHook3
wxGTK
];
strictDeps = true;
# disable installation of the python scripting interface
cmakeFlags = [ "-DBUILD_HSI:BOOl=OFF" ];
postInstall = ''
for p in $out/bin/*; do
wrapProgram "$p" \
--suffix PATH : ${enblend-enfuse}/bin \
--suffix PATH : ${gnumake}/bin \
--suffix PATH : ${perlPackages.ImageExifTool}/bin
done
'';
meta = with lib; {
homepage = "https://hugin.sourceforge.io/";
description = "Toolkit for stitching photographs and assembling panoramas, together with an easy to use graphical front end";
license = licenses.gpl2Plus;
maintainers = with maintainers; [ hrdinka ];
platforms = platforms.linux;
};
}

View File

@@ -0,0 +1,2 @@
source 'https://rubygems.org'
gem 'image_optim'

View File

@@ -0,0 +1,23 @@
GEM
remote: https://rubygems.org/
specs:
exifr (1.4.1)
fspath (3.1.2)
image_optim (0.31.4)
exifr (~> 1.2, >= 1.2.2)
fspath (~> 3.0)
image_size (>= 1.5, < 4)
in_threads (~> 1.3)
progress (~> 3.0, >= 3.0.1)
image_size (3.4.0)
in_threads (1.6.0)
progress (3.6.0)
PLATFORMS
ruby
DEPENDENCIES
image_optim
BUNDLED WITH
2.5.22

View File

@@ -0,0 +1,94 @@
{
lib,
bundlerApp,
bundlerUpdateScript,
makeWrapper,
withPngcrush ? true,
pngcrush,
withPngout ? false,
pngout, # disabled by default because it's unfree
withAdvpng ? true,
advancecomp,
withOptipng ? true,
optipng,
withPngquant ? true,
pngquant,
withOxipng ? true,
oxipng,
withJhead ? true,
jhead,
withJpegoptim ? true,
jpegoptim,
withJpegrecompress ? true,
jpeg-archive,
withJpegtran ? true,
libjpeg,
withGifsicle ? true,
gifsicle,
withSvgo ? true,
svgo,
}:
let
optionalDepsPath =
lib.optional withPngcrush pngcrush
++ lib.optional withPngout pngout
++ lib.optional withAdvpng advancecomp
++ lib.optional withOptipng optipng
++ lib.optional withPngquant pngquant
++ lib.optional withOxipng oxipng
++ lib.optional withJhead jhead
++ lib.optional withJpegoptim jpegoptim
++ lib.optional withJpegrecompress jpeg-archive
++ lib.optional withJpegtran libjpeg
++ lib.optional withGifsicle gifsicle
++ lib.optional withSvgo svgo;
disabledWorkersFlags =
lib.optional (!withPngcrush) "--no-pngcrush"
++ lib.optional (!withPngout) "--no-pngout"
++ lib.optional (!withAdvpng) "--no-advpng"
++ lib.optional (!withOptipng) "--no-optipng"
++ lib.optional (!withPngquant) "--no-pngquant"
++ lib.optional (!withOxipng) "--no-oxipng"
++ lib.optional (!withJhead) "--no-jhead"
++ lib.optional (!withJpegoptim) "--no-jpegoptim"
++ lib.optional (!withJpegrecompress) "--no-jpegrecompress"
++ lib.optional (!withJpegtran) "--no-jpegtran"
++ lib.optional (!withGifsicle) "--no-gifsicle"
++ lib.optional (!withSvgo) "--no-svgo";
in
bundlerApp {
pname = "image_optim";
gemdir = ./.;
exes = [ "image_optim" ];
nativeBuildInputs = [ makeWrapper ];
postBuild = ''
wrapProgram $out/bin/image_optim \
--prefix PATH : ${lib.escapeShellArg (lib.makeBinPath optionalDepsPath)} \
--add-flags "${lib.concatStringsSep " " disabledWorkersFlags}"
'';
passthru.updateScript = bundlerUpdateScript "image_optim";
meta = with lib; {
description = "Optimize images using multiple utilities";
longDescription = ''
Command line tool and ruby interface to optimize (lossless compress,
optionally lossy) jpeg, png, gif and svg images using external utilities
(advpng, gifsicle, jhead, jpeg-recompress, jpegoptim, jpegrescan,
jpegtran, optipng, oxipng, pngcrush, pngout, pngquant, svgo)
'';
homepage = "https://github.com/toy/image_optim";
license = licenses.mit;
maintainers = with maintainers; [
nicknovitski
];
platforms = platforms.all;
mainProgram = "image_optim";
};
}

View File

@@ -0,0 +1,69 @@
{
exifr = {
groups = [ "default" ];
platforms = [ ];
source = {
remotes = [ "https://rubygems.org" ];
sha256 = "155qqhai5z2742aqa4mwkxmqrpcv48siqz55rcx79wvgdg6790vn";
type = "gem";
};
version = "1.4.1";
};
fspath = {
groups = [ "default" ];
platforms = [ ];
source = {
remotes = [ "https://rubygems.org" ];
sha256 = "0xcxikkrjv8ws328nn5ax5pyfjs8pn7djg1hks7qyb3yp6prpb5m";
type = "gem";
};
version = "3.1.2";
};
image_optim = {
dependencies = [
"exifr"
"fspath"
"image_size"
"in_threads"
"progress"
];
groups = [ "default" ];
platforms = [ ];
source = {
remotes = [ "https://rubygems.org" ];
sha256 = "1h3n8x1rlxz4mkk49lij22x1nn0qk5cvir3fsj4x3s382a4x1zsv";
type = "gem";
};
version = "0.31.4";
};
image_size = {
groups = [ "default" ];
platforms = [ ];
source = {
remotes = [ "https://rubygems.org" ];
sha256 = "16h2gxxk212mlvphf03x1z1ddb9k3vm0lgsxbvi4fjg77x8q19f6";
type = "gem";
};
version = "3.4.0";
};
in_threads = {
groups = [ "default" ];
platforms = [ ];
source = {
remotes = [ "https://rubygems.org" ];
sha256 = "0j9132d4g8prjafgdh4pw948j527kr09m2lvylrcd797il9yd9wi";
type = "gem";
};
version = "1.6.0";
};
progress = {
groups = [ "default" ];
platforms = [ ];
source = {
remotes = [ "https://rubygems.org" ];
sha256 = "0wymdk40cwrqn32gwg1kw94s5p1n0z3n7ma7x1s62gd4vw3d63in";
type = "gem";
};
version = "3.6.0";
};
}

View File

@@ -0,0 +1,48 @@
{
lib,
stdenv,
fetchurl,
libX11,
libXinerama,
imlib2,
}:
stdenv.mkDerivation {
pname = "imlibsetroot";
version = "1.2";
src = fetchurl {
url = "https://robotmonkeys.net/wp-content/uploads/2010/03/imlibsetroot-12.tar.gz";
sha256 = "8c1b3b7c861e4d865883ec13a96b8e4ab22464a87d4e6c67255b17a88e3cfd1c";
};
buildInputs = [
libX11
imlib2
libXinerama
];
buildPhase = ''
runHook preBuild
gcc -g imlibsetroot.c -o imlibsetroot \
-I${imlib2.dev}/include -L${imlib2}/lib -lImlib2 \
-I${libX11.dev}/include -lXinerama -lX11
runHook postBuild
'';
installPhase = ''
runHook preInstall
install -D -m 0755 imlibsetroot -t $out/bin
runHook postInstall
'';
meta = with lib; {
description = "Xinerama Aware Background Changer";
homepage = "http://robotmonkeys.net/2010/03/30/imlibsetroot/";
license = licenses.mitAdvertising;
platforms = platforms.linux;
maintainers = with maintainers; [ dwarfmaster ];
mainProgram = "imlibsetroot";
};
}

View File

@@ -0,0 +1,231 @@
{
stdenv,
lib,
boehmgc,
boost,
cairo,
callPackage,
cmake,
desktopToDarwinBundle,
fetchpatch,
fetchurl,
fd,
gettext,
ghostscript,
glib,
glibmm,
gobject-introspection,
gsl,
gspell,
gtk-mac-integration,
gtkmm3,
gdk-pixbuf,
imagemagick,
lcms,
lib2geom,
libcdr,
libexif,
libpng,
librevenge,
librsvg,
libsigcxx,
libvisio,
libwpg,
libXft,
libxml2,
libxslt,
ninja,
perlPackages,
pkg-config,
poppler,
popt,
potrace,
python3,
runCommand,
replaceVars,
wrapGAppsHook3,
libepoxy,
zlib,
yq,
}:
let
python3Env = python3.withPackages (
ps: with ps; [
# List taken almost verbatim from the output of nix-build -A inkscape.passthru.pythonDependencies
appdirs
beautifulsoup4
cachecontrol
cssselect
filelock
inkex
lxml
numpy
packaging
pillow
pygobject3
pyparsing
pyserial
requests
scour
tinycss2
zstandard
]
);
in
stdenv.mkDerivation (finalAttrs: {
pname = "inkscape";
version = "1.4.2";
src = fetchurl {
url = "https://inkscape.org/release/inkscape-${finalAttrs.version}/source/archive/xz/dl/inkscape-${finalAttrs.version}.tar.xz";
sha256 = "sha256-IABTDHkX5SYMnoV1pxVP9pJmQ9IAZIfXFOMEqWPwx4I=";
};
# Inkscape hits the ARGMAX when linking on macOS. It appears to be
# CMakes ARGMAX check doesnt offer enough padding for NIX_LDFLAGS.
# Setting strictDeps it avoids duplicating some dependencies so it
# will leave us under ARGMAX.
strictDeps = true;
patches = [
(replaceVars ./fix-python-paths.patch {
# Python is used at run-time to execute scripts,
# e.g., those from the "Effects" menu.
python3 = lib.getExe python3Env;
})
(replaceVars ./fix-ps2pdf-path.patch {
# Fix path to ps2pdf binary
inherit ghostscript;
})
(fetchpatch {
name = "fix-build-poppler-25.06.0.patch";
url = "https://gitlab.com/inkscape/inkscape/-/commit/97bd8f29a61e691ceea98ca2444b974cf4256ae0.patch";
hash = "sha256-bYRd/KUh/7qFb7x0EuUgQYA9P8abcTf5XS67gzaAiXA=";
})
(fetchpatch {
name = "fix-build-poppler-25.07.0.patch";
url = "https://gitlab.com/inkscape/inkscape/-/commit/ce52c5f96106ae5747171663a46831f21aa52d95.patch";
hash = "sha256-3Yj+neSRSSQPeeZkHJ0P6v3Sis/lg9xiygktI6Z+zDY=";
})
];
postPatch = ''
patchShebangs share/extensions
patchShebangs share/templates
patchShebangs man/fix-roff-punct
# double-conversion is a dependency of 2geom
substituteInPlace CMakeScripts/DefineDependsandFlags.cmake \
--replace-fail 'find_package(DoubleConversion REQUIRED)' ""
# use native Python when cross-compiling
shopt -s globstar
for f in **/CMakeLists.txt; do
substituteInPlace $f \
--replace-quiet "COMMAND python3" "COMMAND ${lib.getExe python3Env.pythonOnBuildForHost}"
done
shopt -u globstar
'';
nativeBuildInputs = [
pkg-config
cmake
ninja
python3Env
glib # for setup hook
gdk-pixbuf # for setup hook
wrapGAppsHook3
gobject-introspection
]
++ (with perlPackages; [
perl
XMLParser
])
++ lib.optionals stdenv.hostPlatform.isDarwin [
desktopToDarwinBundle
];
buildInputs = [
boehmgc
boost
gettext
glib
glibmm
gsl
gtkmm3
imagemagick
lcms
lib2geom
libcdr
libexif
libpng
librevenge
librsvg # for loading icons
libsigcxx
libvisio
libwpg
libXft
libxml2
libxslt
perlPackages.perl
poppler
popt
potrace
python3Env
zlib
libepoxy
]
++ lib.optionals (!stdenv.hostPlatform.isDarwin) [
gspell
]
++ lib.optionals stdenv.hostPlatform.isDarwin [
cairo
gtk-mac-integration
];
# Make sure PyXML modules can be found at run-time.
postInstall = lib.optionalString stdenv.hostPlatform.isDarwin ''
for f in $out/lib/inkscape/*.dylib; do
ln -s $f $out/lib/$(basename $f)
done
'';
passthru = {
tests = {
ps2pdf-plugin = callPackage ./test-ps2pdf-plugin.nix { };
inherit (python3.pkgs) inkex;
};
pythonDependencies =
runCommand "python-dependency-list"
{
nativeBuildInputs = [
fd
yq
];
inherit (finalAttrs) src;
}
''
unpackPhase
tomlq --slurp 'map(.tool.poetry.dependencies | to_entries | map(.key)) | flatten | map(ascii_downcase) | unique' $(fd pyproject.toml) > "$out"
'';
};
meta = {
description = "Vector graphics editor";
homepage = "https://www.inkscape.org";
license = lib.licenses.gpl3Plus;
maintainers = with lib.maintainers; [
jtojnar
x123
Luflosi
];
platforms = lib.platforms.all;
mainProgram = "inkscape";
longDescription = ''
Inkscape is a feature-rich vector graphics editor that edits
files in the W3C SVG (Scalable Vector Graphics) file format.
If you want to import .eps files install ps2edit.
'';
};
})

View File

@@ -0,0 +1,57 @@
{
lib,
stdenv,
fetchFromGitHub,
runCommand,
inkcut,
callPackage,
texlive,
}:
{
applytransforms = callPackage ./extensions/applytransforms { };
hexmap = stdenv.mkDerivation {
pname = "hexmap";
version = "unstable-2023-01-26";
src = fetchFromGitHub {
owner = "lifelike";
repo = "hexmapextension";
rev = "241c9512d0113e8193b7cf06b69ef2c4730b0295";
hash = "sha256-pSPAupp3xLlbODE2BGu1Xiiiu1Y6D4gG4HhZwccAZ2E=";
};
preferLocalBuild = true;
installPhase = ''
runHook preInstall
mkdir -p "$out/share/inkscape/extensions"
cp -p *.inx *.py "$out/share/inkscape/extensions/"
find "$out/share/inkscape/extensions/" -name "*.py" -exec chmod +x {} \;
runHook postInstall
'';
meta = with lib; {
description = "This is an extension for creating hex grids in Inkscape. It can also be used to make brick patterns of staggered rectangles";
homepage = "https://github.com/lifelike/hexmapextension";
license = licenses.gpl2Plus;
maintainers = [ maintainers.raboof ];
platforms = platforms.all;
};
};
inkcut = (
runCommand "inkcut-inkscape-plugin" { } ''
mkdir -p $out/share/inkscape/extensions
cp ${inkcut}/share/inkscape/extensions/* $out/share/inkscape/extensions
''
);
inkstitch = callPackage ./extensions/inkstitch { };
silhouette = callPackage ./extensions/silhouette { };
textext = callPackage ./extensions/textext {
pdflatex = texlive.combined.scheme-basic;
lualatex = texlive.combined.scheme-basic;
};
}

View File

@@ -0,0 +1,43 @@
{
lib,
stdenv,
fetchFromGitHub,
python3,
}:
stdenv.mkDerivation {
pname = "inkscape-applytransforms";
version = "0.pre+unstable=2021-05-11";
src = fetchFromGitHub {
owner = "Klowner";
repo = "inkscape-applytransforms";
rev = "5b3ed4af0fb66e399e686fc2b649b56db84f6042";
sha256 = "XWwkuw+Um/cflRWjIeIgQUxJLrk2DLDmx7K+pMWvIlI=";
};
nativeCheckInputs = [
python3.pkgs.inkex
python3.pkgs.pytestCheckHook
];
dontBuild = true;
doCheck = true;
installPhase = ''
runHook preInstall
install -Dt "$out/share/inkscape/extensions" *.inx *.py
runHook postInstall
'';
meta = with lib; {
description = "Inkscape extension which removes all matrix transforms by applying them recursively to shapes";
homepage = "https://github.com/Klowner/inkscape-applytransforms";
license = licenses.gpl2Only;
maintainers = with maintainers; [ jtojnar ];
platforms = platforms.all;
};
}

View File

@@ -0,0 +1,27 @@
From 64f735a58d3e5cc2344f823e73602eab638d7076 Mon Sep 17 00:00:00 2001
From: tropf <tropf@noreply.codeberg.org>
Date: Mon, 5 Aug 2024 21:25:33 +0200
Subject: [PATCH 1/4] force frozen=true
Enforce installation in frozen mode, i.e. as a packaged version where
source can not be modified.
---
inkstitch.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/inkstitch.py b/inkstitch.py
index efe6f6dec..be8ddf665 100644
--- a/inkstitch.py
+++ b/inkstitch.py
@@ -40,7 +40,7 @@ else:
ini = {}
# --------------------------------------------------------------------------------------------
-running_as_frozen = getattr(sys, 'frozen', None) is not None # check if running from pyinstaller bundle
+running_as_frozen = True
if not running_as_frozen: # override running_as_frozen from DEBUG.toml - for testing
if safe_get(ini, "DEBUG", "force_frozen", default=False):
--
2.49.0

View File

@@ -0,0 +1,34 @@
From c15715af2cfca6603241f4d414b68d43bd4acb98 Mon Sep 17 00:00:00 2001
From: tropf <tropf@noreply.codeberg.org>
Date: Mon, 5 Aug 2024 21:26:13 +0200
Subject: [PATCH 2/4] plugin invocation: use python script as entrypoint
Ink/Stitch is invoked by calling a script with command line parameters.
Depending on the distribution format, this is bundled into a standalone
binary -- at least for vanilla Ink/Stitch. For the nix version, we
follow manual install, which does *not* bundle the file. Hence, the
generation is patched to treat this packaged install as manual install,
and to still refer to the python file.
To keep the patchset small, only an if statement is changed, with the
intent of only using the else path.
---
lib/inx/utils.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/lib/inx/utils.py b/lib/inx/utils.py
index c4cbf6f0d..6d4774ec0 100755
--- a/lib/inx/utils.py
+++ b/lib/inx/utils.py
@@ -21,7 +21,7 @@ def build_environment():
extensions=['jinja2.ext.i18n']
)
- if "BUILD" in os.environ:
+ if False:
# building a ZIP release, with inkstitch packaged as a binary
# Command tag and icons path
if sys.platform == "win32":
--
2.49.0

View File

@@ -0,0 +1,490 @@
From 87d64cbc61175a2adebd4563ac833562a4729295 Mon Sep 17 00:00:00 2001
From: tropf <tropf@noreply.codeberg.org>
Date: Fri, 16 May 2025 23:28:21 +0200
Subject: [PATCH 3/4] lazy-load module to access global_settings
The access to global_settings triggers a read to the home directory on
module inclusion. During the nix build process, this home does not
exist, and hence fails, crashing the entire build.
The inclusion is moved into the function calls, such that it is only
loaded at runtime (where a home should be available), but not at build
time.
The performance impact is considered negligible, as the loads are called
every invocation, but will mostly hit the cache.
Note to self: If this patch is missing, the cache module import will be
the first to trigger the read. This import can be left untouched, as the
underlying cause is defused by this patch.
---
lib/gui/apply_palette.py | 3 ++-
lib/gui/edit_json/main_panel.py | 3 ++-
lib/gui/lettering/main_panel.py | 6 +++++-
lib/gui/lettering_font_sample.py | 4 +++-
lib/gui/preferences.py | 3 ++-
lib/gui/simulator/control_panel.py | 4 +++-
lib/gui/simulator/drawing_panel.py | 6 +++++-
lib/gui/simulator/simulator_preferences.py | 5 ++++-
lib/gui/simulator/split_simulator_window.py | 4 +++-
lib/gui/simulator/view_panel.py | 6 +++++-
lib/metadata.py | 3 +--
lib/sew_stack/stitch_layers/stitch_layer_editor.py | 3 ++-
lib/utils/cache.py | 6 +++---
13 files changed, 40 insertions(+), 16 deletions(-)
diff --git a/lib/gui/apply_palette.py b/lib/gui/apply_palette.py
index 6bc771914..df647d082 100644
--- a/lib/gui/apply_palette.py
+++ b/lib/gui/apply_palette.py
@@ -8,12 +8,12 @@ import wx.adv
from ..i18n import _
from ..threads import ThreadCatalog
-from ..utils.settings import global_settings
class ApplyPaletteFrame(wx.Frame):
def __init__(self, title, **kwargs):
+ from ..utils.settings import global_settings
super().__init__(None, title=title)
self.SetWindowStyle(wx.FRAME_FLOAT_ON_PARENT | wx.DEFAULT_FRAME_STYLE)
@@ -99,6 +99,7 @@ class ApplyPaletteApp(wx.App):
app.MainLoop()
def set_palette(self):
+ from ..utils.settings import global_settings
if self.frame.palette_list.GetSelection() == -1:
return
self.palette = self.frame.palette_list.GetString(self.frame.palette_list.GetSelection())
diff --git a/lib/gui/edit_json/main_panel.py b/lib/gui/edit_json/main_panel.py
index bd43f523b..5eb9d4cc9 100644
--- a/lib/gui/edit_json/main_panel.py
+++ b/lib/gui/edit_json/main_panel.py
@@ -22,7 +22,6 @@ from ...lettering.categories import FONT_CATEGORIES
from ...lettering.font_variant import FontVariant
from ...stitch_plan import stitch_groups_to_stitch_plan
from ...svg.tags import SVG_PATH_TAG
-from ...utils.settings import global_settings
from ...utils.threading import ExitThread, check_stop_flag
from .. import PreviewRenderer, WarningPanel
from . import HelpPanel, SettingsPanel
@@ -33,6 +32,7 @@ LETTER_CASE = {0: '', 1: 'upper', 2: 'lower'}
class LetteringEditJsonPanel(wx.Panel):
def __init__(self, parent, simulator, layer, metadata=None, background_color='white'):
+ from ...utils.settings import global_settings
self.parent = parent
self.simulator = simulator
self.layer = layer
@@ -251,6 +251,7 @@ class LetteringEditJsonPanel(wx.Panel):
return glyph
def on_font_changed(self, event=None):
+ from ...utils.settings import global_settings
selected_font = self.settings_panel.font_chooser.GetValue()
if selected_font:
self.font = self.fonts[selected_font]
diff --git a/lib/gui/lettering/main_panel.py b/lib/gui/lettering/main_panel.py
index 64312b5a1..5ed11b247 100644
--- a/lib/gui/lettering/main_panel.py
+++ b/lib/gui/lettering/main_panel.py
@@ -17,7 +17,6 @@ from ...lettering.categories import FONT_CATEGORIES
from ...stitch_plan import stitch_groups_to_stitch_plan
from ...svg.tags import INKSTITCH_LETTERING
from ...utils import DotDict, cache
-from ...utils.settings import global_settings
from ...utils.threading import ExitThread, check_stop_flag
from .. import PresetsPanel, PreviewRenderer, info_dialog
from . import LetteringHelpPanel, LetteringOptionsPanel
@@ -73,6 +72,7 @@ class LetteringPanel(wx.Panel):
def load_settings(self):
"""Load the settings saved into the SVG group element"""
+ from ...utils.settings import global_settings
self.settings = DotDict({
"text": "",
@@ -184,12 +184,14 @@ class LetteringPanel(wx.Panel):
@property
def default_font(self):
+ from ...utils.settings import global_settings
try:
return self.fonts[global_settings['last_font']]
except KeyError:
return list(self.fonts.values())[0]
def on_change(self, attribute, event):
+ from ...utils.settings import global_settings
value = event.GetEventObject().GetValue()
self.settings[attribute] = value
if attribute == "text" and self.options_panel.font_glyph_filter.GetValue() is True:
@@ -206,6 +208,7 @@ class LetteringPanel(wx.Panel):
self.update_preview()
def on_choice_change(self, attribute, event=None):
+ from ...utils.settings import global_settings
value = event.GetEventObject().GetCurrentSelection()
self.settings[attribute] = value
if attribute == 'trim_option':
@@ -215,6 +218,7 @@ class LetteringPanel(wx.Panel):
self.update_preview()
def on_font_changed(self, event=None):
+ from ...utils.settings import global_settings
font = self.fonts.get(self.options_panel.font_chooser.GetValue(), self.default_font)
self.settings.font = font.marked_custom_font_id
global_settings['last_font'] = font.marked_custom_font_name
diff --git a/lib/gui/lettering_font_sample.py b/lib/gui/lettering_font_sample.py
index e19544dce..c2f7fcaaa 100644
--- a/lib/gui/lettering_font_sample.py
+++ b/lib/gui/lettering_font_sample.py
@@ -13,12 +13,12 @@ from ..commands import ensure_command_symbols
from ..i18n import _
from ..lettering import get_font_list
from ..marker import ensure_marker_symbols
-from ..utils.settings import global_settings
class FontSampleFrame(wx.Frame):
def __init__(self, *args, **kwargs):
+ from ..utils.settings import global_settings
self.layer = kwargs.pop("layer")
wx.Frame.__init__(self, None, wx.ID_ANY, _("Font Sampling"), *args, **kwargs)
@@ -135,6 +135,7 @@ class FontSampleFrame(wx.Frame):
self.font_chooser.Append(font.marked_custom_font_name)
def on_font_changed(self, event=None):
+ from ..utils.settings import global_settings
selected_font = self.font_chooser.GetValue()
if selected_font:
self.font = self.fonts[selected_font]
@@ -157,6 +158,7 @@ class FontSampleFrame(wx.Frame):
self.color_sort_checkbox.Disable()
def apply(self, event):
+ from ..utils.settings import global_settings
# apply scale to layer and extract for later use
self.layer.transform.add_scale(self.scale_spinner.GetValue() / 100)
scale = self.layer.transform.a
diff --git a/lib/gui/preferences.py b/lib/gui/preferences.py
index 23dbbf0c6..13684acb9 100644
--- a/lib/gui/preferences.py
+++ b/lib/gui/preferences.py
@@ -7,11 +7,11 @@ import wx
from ..i18n import _
from ..utils.cache import get_stitch_plan_cache
-from ..utils.settings import global_settings
class PreferencesFrame(wx.Frame):
def __init__(self, *args, **kwargs):
+ from ..utils.settings import global_settings
self.extension = kwargs.pop("extension")
wx.Frame.__init__(self, None, wx.ID_ANY, _("Preferences"), *args, **kwargs)
self.SetTitle(_("Preferences"))
@@ -180,6 +180,7 @@ class PreferencesFrame(wx.Frame):
stitch_plan_cache.clear(retry=True)
def apply(self):
+ from ..utils.settings import global_settings
metadata = self.extension.get_inkstitch_metadata()
metadata['min_stitch_len_mm'] = self.minimum_stitch_length.GetValue()
metadata['collapse_len_mm'] = self.minimum_jump_stitch_length.GetValue()
diff --git a/lib/gui/simulator/control_panel.py b/lib/gui/simulator/control_panel.py
index 99d1f92ba..1bd9e1872 100644
--- a/lib/gui/simulator/control_panel.py
+++ b/lib/gui/simulator/control_panel.py
@@ -11,7 +11,6 @@ from wx.lib.intctrl import IntCtrl
from ...debug.debug import debug
from ...i18n import _
from ...utils import get_resource_dir
-from ...utils.settings import global_settings
from . import SimulatorSlider
@@ -21,6 +20,7 @@ class ControlPanel(wx.Panel):
@debug.time
def __init__(self, parent, *args, **kwargs):
""""""
+ from ...utils.settings import global_settings
self.parent = parent
self.stitch_plan = kwargs.pop('stitch_plan', None)
self.detach_callback = kwargs.pop('detach_callback', None)
@@ -204,6 +204,7 @@ class ControlPanel(wx.Panel):
return icon.ConvertToBitmap()
def choose_speed(self):
+ from ...utils.settings import global_settings
if not global_settings['simulator_adaptive_speed']:
self.set_speed(global_settings['simulator_speed'])
return
@@ -233,6 +234,7 @@ class ControlPanel(wx.Panel):
self.animation_reverse()
def set_speed(self, speed):
+ from ...utils.settings import global_settings
global_settings['simulator_speed'] = speed
self.speed = int(max(speed, 1))
self.update_speed_text()
diff --git a/lib/gui/simulator/drawing_panel.py b/lib/gui/simulator/drawing_panel.py
index abe6fa0fb..036a7b2a6 100644
--- a/lib/gui/simulator/drawing_panel.py
+++ b/lib/gui/simulator/drawing_panel.py
@@ -11,7 +11,6 @@ from numpy import split
from ...debug.debug import debug
from ...i18n import _
from ...svg import PIXELS_PER_MM
-from ...utils.settings import global_settings
# L10N command label at bottom of simulator window
COMMAND_NAMES = [_("STITCH"), _("JUMP"), _("TRIM"), _("STOP"), _("COLOR CHANGE")]
@@ -37,6 +36,7 @@ class DrawingPanel(wx.Panel):
def __init__(self, parent, *args, **kwargs):
""""""
+ from ...utils.settings import global_settings
self.parent = parent
self.stitch_plan = kwargs.pop('stitch_plan', None)
kwargs['style'] = wx.BORDER_SUNKEN
@@ -269,6 +269,7 @@ class DrawingPanel(wx.Panel):
canvas.StrokeLines(block)
def draw_needle_penetration_points(self, canvas, pen, stitches):
+ from ...utils.settings import global_settings
if self.view_panel.btnNpp.GetValue():
npp_size = global_settings['simulator_npp_size'] * PIXELS_PER_MM * self.PIXEL_DENSITY
npp_pen = wx.Pen(pen.GetColour(), width=int(npp_size))
@@ -364,11 +365,13 @@ class DrawingPanel(wx.Panel):
pass
def color_to_pen(self, color):
+ from ...utils.settings import global_settings
line_width = global_settings['simulator_line_width'] * PIXELS_PER_MM * self.PIXEL_DENSITY
background_color = self.GetBackgroundColour().GetAsString()
return wx.Pen(list(map(int, color.visible_on_background(background_color).rgb)), int(line_width))
def update_pen_size(self):
+ from ...utils.settings import global_settings
line_width = global_settings['simulator_line_width'] * PIXELS_PER_MM * self.PIXEL_DENSITY
for pen in self.pens:
pen.SetWidth(int(line_width))
@@ -421,6 +424,7 @@ class DrawingPanel(wx.Panel):
self.jumps.append(jumps)
def set_speed(self, speed):
+ from ...utils.settings import global_settings
self.speed = speed
global_settings['simulator_speed'] = speed
diff --git a/lib/gui/simulator/simulator_preferences.py b/lib/gui/simulator/simulator_preferences.py
index 7b72b87de..bfebc7cbe 100644
--- a/lib/gui/simulator/simulator_preferences.py
+++ b/lib/gui/simulator/simulator_preferences.py
@@ -6,7 +6,6 @@
import wx
from ...i18n import _
-from ...utils.settings import global_settings
class SimulatorPreferenceDialog(wx.Dialog):
@@ -14,6 +13,7 @@ class SimulatorPreferenceDialog(wx.Dialog):
"""
def __init__(self, *args, **kwargs):
+ from ...utils.settings import global_settings
super(SimulatorPreferenceDialog, self).__init__(*args, **kwargs)
self.SetWindowStyle(wx.FRAME_FLOAT_ON_PARENT | wx.DEFAULT_FRAME_STYLE)
@@ -62,18 +62,21 @@ class SimulatorPreferenceDialog(wx.Dialog):
self.SetSizerAndFit(sizer)
def on_change(self, attribute, event):
+ from ...utils.settings import global_settings
global_settings[attribute] = event.EventObject.GetValue()
if self.drawing_panel.loaded and attribute == 'simulator_line_width':
self.drawing_panel.update_pen_size()
self.drawing_panel.Refresh()
def on_adaptive_speed_changed(self, event=None):
+ from ...utils.settings import global_settings
adaptive_speed = self.adaptive_speed.GetValue()
global_settings['simulator_adaptive_speed'] = adaptive_speed
self.control_panel.choose_speed()
self.control_panel.Refresh()
def save_settings(self):
+ from ...utils.settings import global_settings
global_settings['simulator_line_width'] = self.line_width.GetValue()
global_settings['simulator_npp_size'] = self.npp_size.GetValue()
diff --git a/lib/gui/simulator/split_simulator_window.py b/lib/gui/simulator/split_simulator_window.py
index e4b2803e2..6513b6d3d 100644
--- a/lib/gui/simulator/split_simulator_window.py
+++ b/lib/gui/simulator/split_simulator_window.py
@@ -8,12 +8,12 @@ import wx
from ...debug.debug import debug
from ...utils import get_resource_dir
-from ...utils.settings import global_settings
from . import SimulatorPanel, SimulatorWindow
class SplitSimulatorWindow(wx.Frame):
def __init__(self, panel_class, title, target_duration=None, **kwargs):
+ from ...utils.settings import global_settings
super().__init__(None, title=title)
self.SetWindowStyle(wx.FRAME_FLOAT_ON_PARENT | wx.DEFAULT_FRAME_STYLE)
@@ -89,6 +89,7 @@ class SplitSimulatorWindow(wx.Frame):
self.detach_simulator()
def attach_simulator(self):
+ from ...utils.settings import global_settings
self.detached_simulator_frame.detach_simulator_panel()
self.simulator_panel.Reparent(self.splitter)
self.splitter.SplitVertically(self.settings_panel, self.simulator_panel)
@@ -105,6 +106,7 @@ class SplitSimulatorWindow(wx.Frame):
global_settings['pop_out_simulator'] = False
def detach_simulator(self):
+ from ...utils.settings import global_settings
self.splitter.Unsplit()
self.detached_simulator_frame = SimulatorWindow(panel=self.simulator_panel, parent=self)
self.splitter.SetMinimumPaneSize(100)
diff --git a/lib/gui/simulator/view_panel.py b/lib/gui/simulator/view_panel.py
index e2f2618d8..abbbc49d4 100644
--- a/lib/gui/simulator/view_panel.py
+++ b/lib/gui/simulator/view_panel.py
@@ -9,7 +9,6 @@ from ...debug.debug import debug
from ...i18n import _
from . import SimulatorPreferenceDialog
from . import DesignInfoDialog
-from ...utils.settings import global_settings
class ViewPanel(ScrolledPanel):
@@ -18,6 +17,7 @@ class ViewPanel(ScrolledPanel):
@debug.time
def __init__(self, parent, detach_callback):
""""""
+ from ...utils.settings import global_settings
self.parent = parent
self.detach_callback = detach_callback
ScrolledPanel.__init__(self, parent)
@@ -159,14 +159,17 @@ class ViewPanel(ScrolledPanel):
self.toggle_npp(event)
def toggle_npp(self, event):
+ from ...utils.settings import global_settings
self.drawing_panel.Refresh()
global_settings['npp_button_status'] = self.btnNpp.GetValue()
def on_cursor_button(self, event):
+ from ...utils.settings import global_settings
self.drawing_panel.Refresh()
global_settings['display_crosshair'] = self.btnCursor.GetValue()
def toggle_page(self, event):
+ from ...utils.settings import global_settings
debug.log("toggle page")
value = self.btnPage.GetValue()
self.drawing_panel.set_show_page(value)
@@ -174,6 +177,7 @@ class ViewPanel(ScrolledPanel):
global_settings['toggle_page_button_status'] = value
def on_marker_button(self, marker_type, event):
+ from ...utils.settings import global_settings
value = event.GetEventObject().GetValue()
self.control_panel.slider.enable_marker_list(marker_type, value)
if marker_type == 'jump':
diff --git a/lib/metadata.py b/lib/metadata.py
index 837fbf008..0beaeeb7a 100644
--- a/lib/metadata.py
+++ b/lib/metadata.py
@@ -5,8 +5,6 @@ from collections.abc import MutableMapping
import inkex
from lxml import etree
-from .utils.settings import DEFAULT_METADATA, global_settings
-
def strip_namespace(tag):
"""Remove xml namespace from a tag name.
@@ -33,6 +31,7 @@ class InkStitchMetadata(MutableMapping):
"""
def __init__(self, document):
+ from .utils.settings import DEFAULT_METADATA, global_settings
super().__init__()
self.document = document
self.metadata = document.metadata
diff --git a/lib/sew_stack/stitch_layers/stitch_layer_editor.py b/lib/sew_stack/stitch_layers/stitch_layer_editor.py
index eddf78675..4a5dfcf40 100644
--- a/lib/sew_stack/stitch_layers/stitch_layer_editor.py
+++ b/lib/sew_stack/stitch_layers/stitch_layer_editor.py
@@ -7,7 +7,6 @@ import wx.propgrid
from ...debug.debug import debug
from ...gui.windows import SimpleBox
from ...i18n import _
-from ...utils.settings import global_settings
class CheckBoxProperty(wx.propgrid.BoolProperty):
@@ -311,6 +310,7 @@ class StitchLayerEditor:
return any(property.HasFlag(wx.propgrid.PG_PROP_MODIFIED) for property in self.property_grid.Items)
def get_panel(self, parent):
+ from ...utils.settings import global_settings
if self.property_grid_panel is None:
self.layer_editor_panel = wx.Panel(parent, wx.ID_ANY)
@@ -426,6 +426,7 @@ class StitchLayerEditor:
self.property_grid.RefreshEditor()
def on_sash_position_changed(self, event):
+ from ...utils.settings import global_settings
global_settings['stitch_layer_editor_sash_position'] = event.GetSashPosition()
def show_help(self, property):
diff --git a/lib/utils/cache.py b/lib/utils/cache.py
index cca6296a9..6ecdf6403 100644
--- a/lib/utils/cache.py
+++ b/lib/utils/cache.py
@@ -10,9 +10,6 @@ import sqlite3
import diskcache # type: ignore[import-untyped]
-from lib.utils.settings import global_settings
-
-from .paths import get_user_dir
from functools import lru_cache
@@ -25,6 +22,8 @@ __stitch_plan_cache = None
def get_stitch_plan_cache():
+ from .paths import get_user_dir
+ from lib.utils.settings import global_settings
global __stitch_plan_cache
if __stitch_plan_cache is None:
@@ -51,6 +50,7 @@ def get_stitch_plan_cache():
def is_cache_disabled():
+ from lib.utils.settings import global_settings
return not global_settings['cache_size']
--
2.49.0

View File

@@ -0,0 +1,31 @@
From 99c895045df01e291c6c9dc89b7a1c758e010bda Mon Sep 17 00:00:00 2001
From: tropf <tropf@noreply.codeberg.org>
Date: Sat, 26 Oct 2024 14:07:17 +0200
Subject: [PATCH 4/4] enable force-insertion of python path
As of now, the inkex library loaded by inkstitch must be fixed. The
version supplied by inkscape is not sufficient. This should be fixed
with inkscape 1.4, where this patch can be removed.
The fixed path is injected through an environment variable at runtime.
---
inkstitch.py | 3 +++
1 file changed, 3 insertions(+)
diff --git a/inkstitch.py b/inkstitch.py
index be8ddf665..d7a8fca2f 100644
--- a/inkstitch.py
+++ b/inkstitch.py
@@ -105,6 +105,9 @@ if not running_as_frozen: # debugging/profiling only in development mode
if prefer_pip_inkex and 'PYTHONPATH' in os.environ:
debug_utils.reorder_sys_path()
+if "PYTHON_INKEX_PATH" in os.environ:
+ sys.path = [os.environ["PYTHON_INKEX_PATH"]] + sys.path
+
# enabling of debug depends on value of debug_type in DEBUG.toml file
if debug_type != 'none':
from lib.debug.debugger import init_debugger
--
2.49.0

View File

@@ -0,0 +1,127 @@
{
lib,
python3,
fetchFromGitHub,
fetchFromGitLab,
gettext,
}:
let
# on update check compatibility to nixpkgs inkex
version = "3.2.2";
# remove and use nixpkgs version is recent enough
inkex' = python3.pkgs.inkex.overrideAttrs (old: rec {
# this is no special commit, just the most recent as of writing
version = "3150a5b3b06f7e4c2104d9e8eb6dc448982bb2b0";
src = fetchFromGitLab {
owner = "inkscape";
repo = "extensions";
rev = "${version}";
hash = "sha256-FYBZ66ERC3nVYCaAmFPqKnBxDOKAoQwT14C0fKLn10c=";
};
postPatch = ''
substituteInPlace pyproject.toml \
--replace-fail 'scour = "^0.37"' 'scour = ">=0.37"'
'';
});
dependencies =
with python3.pkgs;
[
pyembroidery
# inkex upstream release & nixpkgs is too old
# use nixpkgs inkex once up to date
inkex'
wxpython
networkx
platformdirs
shapely
lxml
appdirs
numpy
jinja2
requests
colormath2
flask
fonttools
trimesh
scipy
diskcache
flask-cors
]
# Inkstitch uses the builtin tomllib instead when Python >=3.11
++ lib.optional (pythonOlder "3.11") tomli;
pyEnv = python3.withPackages (_: dependencies);
in
python3.pkgs.buildPythonApplication {
pname = "inkstitch";
inherit version;
pyproject = false; # Uses a Makefile (yikes)
src = fetchFromGitHub {
owner = "inkstitch";
repo = "inkstitch";
tag = "v${version}";
hash = "sha256-6EVfjmTXEYgZta01amK8E6t5h2JBPfGGNnqfBG8LQfo=";
};
nativeBuildInputs = [
gettext
pyEnv
];
inherit dependencies;
env = {
# to overwrite version string
GITHUB_REF = version;
BUILD = "nixpkgs";
};
makeFlags = [ "manual" ];
installPhase = ''
runHook preInstall
mkdir -p $out/share/inkscape/extensions
cp -a . $out/share/inkscape/extensions/inkstitch
runHook postInstall
'';
patches = [
./0001-force-frozen-true.patch
./0002-plugin-invocation-use-python-script-as-entrypoint.patch
./0003-lazy-load-module-to-access-global_settings.patch
./0004-enable-force-insertion-of-python-path.patch
];
doCheck = false;
postPatch = ''
# Add shebang with python dependencies
substituteInPlace lib/inx/utils.py --replace-fail ' interpreter="python"' ""
sed -i -e '1i#!${pyEnv.interpreter}' inkstitch.py
chmod a+x inkstitch.py
'';
postInstall = ''
export SITE_PACKAGES=$(find "${pyEnv}" -type d -name 'site-packages')
wrapProgram $out/share/inkscape/extensions/inkstitch/inkstitch.py \
--set PYTHON_INKEX_PATH "$SITE_PACKAGES"
'';
nativeCheckInputs = with python3.pkgs; [
pytestCheckHook
];
meta = {
description = "Inkscape extension for machine embroidery design";
homepage = "https://inkstitch.org/";
license = with lib.licenses; [ gpl3Plus ];
maintainers = with lib.maintainers; [
tropf
pluiedev
];
};
}

View File

@@ -0,0 +1,94 @@
{
fetchFromGitHub,
lib,
gettext,
python3,
udevCheckHook,
umockdev,
writeScript,
}:
let
# We need these simple wrapper shell scripts because Inkscape extensions with
# interpreter="shell" always get invoked with the `sh` command [0], regardless of
# the shebang at the top of the script.
# [0]: https://gitlab.com/inkscape/inkscape/-/blob/d61d917afb94721c92a650b2c4b116b0a4826f41/src/extension/implementation/script.cpp#L93
launch-sendto_silhouette = writeScript "sendto_silhouette.sh" ''
cd $(dirname $0)
./sendto_silhouette.py "$@"
'';
launch-silhouette_multi = writeScript "silhouette_multi.sh" ''
cd $(dirname $0)
./silhouette_multi.py "$@"
'';
in
python3.pkgs.buildPythonApplication rec {
pname = "inkscape-silhouette";
version = "1.29";
format = "setuptools";
src = fetchFromGitHub {
owner = "fablabnbg";
repo = "inkscape-silhouette";
tag = "v${version}";
sha256 = "sha256-MfR88BuaAx6n5XRIjslpIk4PnDf6TLU9AsmHxKkcFS0=";
};
patches = [
./interpreter.patch
./use-prefix-for-udev.patch
];
propagatedBuildInputs = [
python3.pkgs.pyusb
python3.pkgs.lxml
python3.pkgs.inkex
python3.pkgs.matplotlib
python3.pkgs.wxpython
python3.pkgs.xmltodict
];
nativeBuildInputs = [
gettext # msgfmt
];
nativeCheckInputs = [
python3.pkgs.pytestCheckHook
udevCheckHook
umockdev
];
enabledTestPaths = [
"test"
];
doCheck = true;
doInstallCheck = true;
installPhase = ''
runHook preInstall
make install PREFIX=$out
runHook postInstall
'';
postInstall = ''
# Unmark read_dump.py as executable so wrapPythonProgramsIn won't turn it
# into a shell script (thereby making it impossible to import as a Python
# module).
chmod -x $out/share/inkscape/extensions/silhouette/read_dump.py
cp ${launch-sendto_silhouette} $out/share/inkscape/extensions/sendto_silhouette.sh
cp ${launch-silhouette_multi} $out/share/inkscape/extensions/silhouette_multi.sh
'';
postFixup = ''
wrapPythonProgramsIn "$out/share/inkscape/extensions/" "$out $pythonPath"
'';
meta = with lib; {
description = "Extension to drive Silhouette vinyl cutters (e.g. Cameo, Portrait, Curio series) from within Inkscape";
homepage = "https://github.com/fablabnbg/inkscape-silhouette";
license = licenses.gpl2Only;
maintainers = with maintainers; [ jfly ];
platforms = platforms.all;
};
}

View File

@@ -0,0 +1,24 @@
diff --git a/sendto_silhouette.inx b/sendto_silhouette.inx
index 55a3278..d780730 100644
--- a/sendto_silhouette.inx
+++ b/sendto_silhouette.inx
@@ -188,6 +188,6 @@ Always use the least amount of blade possible.
</effect>
<script>
- <command location="inx" interpreter="python">sendto_silhouette.py</command>
+ <command location="inx" interpreter="shell">sendto_silhouette.sh</command>
</script>
</inkscape-extension>
diff --git a/silhouette_multi.inx b/silhouette_multi.inx
index f6fd2ed..2d9dba6 100644
--- a/silhouette_multi.inx
+++ b/silhouette_multi.inx
@@ -31,6 +31,6 @@
</effect>
<script>
- <command location="inx" interpreter="python">silhouette_multi.py</command>
+ <command location="inx" interpreter="shell">silhouette_multi.sh</command>
</script>
</inkscape-extension>

View File

@@ -0,0 +1,13 @@
diff --git a/Makefile b/Makefile
index 5aff25d..43c3fb0 100644
--- a/Makefile
+++ b/Makefile
@@ -22,7 +22,7 @@ VERS=$$(python3 ./sendto_silhouette.py --version)
DEST=$(DESTDIR)$(PREFIX)/share/inkscape/extensions
LOCALE=$(DESTDIR)$(PREFIX)/share/locale
-UDEV=$(DESTDIR)/lib/udev
+UDEV=$(DESTDIR)$(PREFIX)/lib/udev
INKSCAPE_TEMPLATES=$(DESTDIR)$(PREFIX)/share/inkscape/templates
# User-specifc inkscape extensions folder for local install

View File

@@ -0,0 +1,127 @@
{
lib,
writeScript,
fetchFromGitHub,
replaceVars,
inkscape,
pdflatex,
lualatex,
python3,
wrapGAppsHook3,
gobject-introspection,
gtk3,
gtksourceview3,
}:
let
launchScript = writeScript "launch.sh" ''
cd $(dirname $0)
./__main__.py $*
'';
in
python3.pkgs.buildPythonApplication rec {
pname = "textext";
version = "1.12.0";
format = "setuptools";
src = fetchFromGitHub {
owner = "textext";
repo = "textext";
tag = version;
sha256 = "sha256-Ka8NIvzhMZYPlc3q0U5Je7eXyBT61dJ3O++ETl+D7w0=";
};
patches = [
# Make sure we can point directly to pdflatex in the extension,
# instead of relying on the PATH (which might not have it)
(replaceVars ./fix-paths.patch {
inherit pdflatex lualatex;
})
# Since we are wrapping the extension, we need to change the interpreter
# from Python to Bash.
./interpreter.patch
];
nativeBuildInputs = [
wrapGAppsHook3
gobject-introspection
];
buildInputs = [
gtk3
gtksourceview3
];
propagatedBuildInputs = [
python3.pkgs.pygobject3
# lxml, cssselect and numpy are required by inkex but is not inherited from inkscape when we use custom Python interpreter:
python3.pkgs.lxml
python3.pkgs.cssselect
python3.pkgs.numpy
python3.pkgs.tinycss2
];
# strictDeps do not play nicely with introspection setup hooks.
# https://github.com/NixOS/nixpkgs/issues/56943
strictDeps = false;
# TexText doesnt have a 'bdist_wheel' target.
dontUseSetuptoolsBuild = true;
# TexText doesnt have a 'test' target.
doCheck = false;
# Avoid wrapping two times by just using Pythons wrapping.
dontWrapGApps = true;
buildPhase = ''
runHook preBuild
mkdir dist
# source/setup.py creates a config file in HOME (that we ignore)
mkdir buildhome
export HOME=$(pwd)/buildhome
python setup.py \
--inkscape-executable=${inkscape}/bin/inkscape \
--pdflatex-executable=${pdflatex}/bin/pdflatex \
--lualatex-executable=${lualatex}/bin/lualatex \
--inkscape-extensions-path=dist
runHook postBuild
'';
installPhase = ''
runHook preInstall
mkdir -p $out/share/inkscape/extensions
cp -r dist/textext $out/share/inkscape/extensions
runHook postInstall
'';
preFixup = ''
# Prepare for wrapping
chmod +x "$out/share/inkscape/extensions/textext/__main__.py"
sed -i '1i#!/usr/bin/env python3' "$out/share/inkscape/extensions/textext/__main__.py"
# Include gobject-introspection typelibs in the wrapper.
makeWrapperArgs+=("''${gappsWrapperArgs[@]}")
'';
postFixup = ''
# Wrap the project so it can find runtime dependencies.
wrapPythonProgramsIn "$out/share/inkscape/extensions/textext" "$out $pythonPath"
cp ${launchScript} $out/share/inkscape/extensions/textext/launch.sh
'';
meta = with lib; {
description = "Re-editable LaTeX graphics for Inkscape";
homepage = "https://textext.github.io/textext/";
license = licenses.bsd3;
maintainers = [ maintainers.raboof ];
platforms = platforms.all;
};
}

View File

@@ -0,0 +1,19 @@
--- a/textext/base.py
+++ b/textext/base.py
@@ -95,7 +95,16 @@ class TexText(inkex.EffectExtension):
def __init__(self):
self.config = Settings(directory=defaults.textext_config_path)
+ # config.json is stored in ~/.config/inkscape/extensions/textext for
+ # the next invocation, but since that next invocation could be using
+ # a different latex derivation, make sure we overwrite the executable
+ # paths with updated ones:
+ self.config["pdflatex-executable"] = "@pdflatex@/bin/pdflatex";
+ self.config["lualatex-executable"] = "@lualatex@/bin/lualatex";
self.cache = Cache(directory=defaults.textext_config_path)
+ if "requirements_checker" in self.cache.values:
+ self.cache["requirements_checker"]["available_tex_to_pdf_converters"]["pdflatex"] = "@pdflatex@/bin/pdflatex";
+ self.cache["requirements_checker"]["available_tex_to_pdf_converters"]["lualatex"] = "@lualatex@/bin/lualatex";
previous_exit_code = self.cache.get("previous_exit_code", None)
if previous_exit_code is None:

View File

@@ -0,0 +1,10 @@
--- a/textext/textext.inx
+++ b/textext/textext.inx
@@ -8,6 +8,6 @@
</effects-menu>
</effect>
<script>
- <command location="inx" interpreter="python">__main__.py</command>
+ <command location="inx" interpreter="shell">launch.sh</command>
</script>
</inkscape-extension>

View File

@@ -0,0 +1,36 @@
diff -Naur inkscape-1.2.2_2022-12-01_b0a8486541.orig/share/extensions/eps_input.inx inkscape-1.2.2_2022-12-01_b0a8486541/share/extensions/eps_input.inx
--- inkscape-1.2.2_2022-12-01_b0a8486541.orig/share/extensions/eps_input.inx 2023-08-02 22:22:32.000000000 +0400
+++ inkscape-1.2.2_2022-12-01_b0a8486541/share/extensions/eps_input.inx 2023-08-02 22:23:34.000000000 +0400
@@ -3,7 +3,7 @@
<name>EPS Input</name>
<id>org.inkscape.input.eps</id>
<dependency type="extension">org.inkscape.input.pdf</dependency>
- <dependency type="executable" location="path">ps2pdf</dependency>
+ <dependency type="executable" location="absolute">@ghostscript@/bin/ps2pdf</dependency>
<param name="crop" type="bool" gui-hidden="true">true</param>
<param name="autorotate" type="optiongroup" appearance="combo" gui-text="Determine page orientation from text direction"
gui-description="The PS/EPS importer can try to determine the page orientation such that the majority of the text runs left-to-right.">
diff -Naur inkscape-1.2.2_2022-12-01_b0a8486541.orig/share/extensions/ps_input.inx inkscape-1.2.2_2022-12-01_b0a8486541/share/extensions/ps_input.inx
--- inkscape-1.2.2_2022-12-01_b0a8486541.orig/share/extensions/ps_input.inx 2023-08-02 22:22:33.000000000 +0400
+++ inkscape-1.2.2_2022-12-01_b0a8486541/share/extensions/ps_input.inx 2023-08-02 22:24:00.000000000 +0400
@@ -3,7 +3,7 @@
<name>PostScript Input</name>
<id>org.inkscape.input.postscript_input</id>
<dependency type="extension">org.inkscape.input.pdf</dependency>
- <dependency type="executable" location="path">ps2pdf</dependency>
+ <dependency type="executable" location="absolute">@ghostscript@/bin/ps2pdf</dependency>
<param name="autorotate" type="optiongroup" appearance="combo" gui-text="Determine page orientation from text direction"
gui-description="The PS/EPS importer can try to determine the page orientation such that the majority of the text runs left-to-right.">
<option value="None">Disabled</option>
diff -Naur inkscape-1.2.2_2022-12-01_b0a8486541.orig/share/extensions/ps_input.py inkscape-1.2.2_2022-12-01_b0a8486541/share/extensions/ps_input.py
--- inkscape-1.2.2_2022-12-01_b0a8486541.orig/share/extensions/ps_input.py 2023-08-02 22:22:32.000000000 +0400
+++ inkscape-1.2.2_2022-12-01_b0a8486541/share/extensions/ps_input.py 2023-08-02 22:23:48.000000000 +0400
@@ -79,7 +79,7 @@
else:
try:
call(
- "ps2pdf",
+ "@ghostscript@/bin/ps2pdf",
crop,
"-dAutoRotatePages=/" + self.options.autorotate,
input_file,

View File

@@ -0,0 +1,17 @@
diff --git a/src/extension/implementation/script.cpp b/src/extension/implementation/script.cpp
index bc6c0ed845..181467834d 100644
--- a/src/extension/implementation/script.cpp
+++ b/src/extension/implementation/script.cpp
@@ -82,10 +82,10 @@ const std::map<std::string, Script::interpreter_t> Script::interpreterTab = {
{ "python", {"python-interpreter", {"pythonw" }}},
#elif defined __APPLE__
{ "perl", {"perl-interpreter", {"perl" }}},
- { "python", {"python-interpreter", {"python3" }}},
+ { "python", {"python-interpreter", {"@python3@" }}},
#else
{ "perl", {"perl-interpreter", {"perl" }}},
- { "python", {"python-interpreter", {"python3", "python" }}},
+ { "python", {"python-interpreter", {"@python3@" }}},
#endif
{ "python2", {"python2-interpreter", {"python2", "python" }}},
{ "ruby", {"ruby-interpreter", {"ruby" }}},

View File

@@ -0,0 +1,32 @@
{
inkscape,
runCommand,
writeTextFile,
}:
let
svg_file = writeTextFile {
name = "test.svg";
text = ''
<?xml version="1.0" encoding="UTF-8"?>
<svg width="50" height="50" version="1.1">
<ellipse cx="1" cy="1" rx="1" ry="1" />
</svg>'';
};
in
runCommand "inkscape-test-eps"
{
nativeBuildInputs = [ inkscape ];
}
''
echo ps test
inkscape ${svg_file} --export-type=ps -o test.ps
inkscape test.ps -o test.ps.svg
echo eps test
inkscape ${svg_file} --export-type=eps -o test.eps
inkscape test.eps -o test.eps.svg
# inkscape does not return an error code, only does not create files
[[ -f test.ps.svg && -f test.eps.svg ]] && touch $out
''

View File

@@ -0,0 +1,30 @@
{
lib,
inkscape,
symlinkJoin,
makeWrapper,
inkscapeExtensions ? [ ],
inkscape-extensions,
}:
let
allExtensions = lib.filter (pkg: lib.isDerivation pkg && !pkg.meta.broken or false) (
lib.attrValues inkscape-extensions
);
selectedExtensions = if inkscapeExtensions == null then allExtensions else inkscapeExtensions;
in
symlinkJoin {
name = "inkscape-with-extensions-${lib.getVersion inkscape}";
paths = [ inkscape ] ++ selectedExtensions;
nativeBuildInputs = [ makeWrapper ];
postBuild = ''
rm -f $out/bin/inkscape
makeWrapper "${inkscape}/bin/inkscape" "$out/bin/inkscape" --set INKSCAPE_DATADIR "$out/share"
'';
inherit (inkscape) meta;
}

View File

@@ -0,0 +1,91 @@
{
lib,
stdenv,
cmake,
fetchFromGitHub,
fetchpatch,
pkg-config,
boost,
exiv2,
fftwFloat,
gsl,
ilmbase,
lcms2,
libraw,
libtiff,
openexr,
libsForQt5,
eigen,
}:
stdenv.mkDerivation rec {
pname = "luminance-hdr";
version = "2.6.1.1";
src = fetchFromGitHub {
owner = "LuminanceHDR";
repo = "LuminanceHDR";
rev = "v.${version}";
sha256 = "sha256-PWqtYGx8drfMVp7D7MzN1sIUTQ+Xz5yyeHN87p2r6PY=";
};
patches = [
(fetchpatch {
name = "exiv2-0.28.patch";
url = "https://gitlab.archlinux.org/archlinux/packaging/packages/luminancehdr/-/raw/2e4a7321c7d20a52da104f4aa4dc76ac7224d94b/exiv2-0.28.patch";
hash = "sha256-Hj+lqAd5VuTjmip8Po7YiGOWWDxnu4IMXOiEFBukXpk=";
})
(fetchpatch {
name = "luminance-hdr-Fix-building-with-Boost-1.85.0.patch";
url = "https://github.com/LuminanceHDR/LuminanceHDR/commit/33b364f76b0edca4352cf701c1557d0c0e796c4f.patch";
hash = "sha256-jzyfKFmmzo6WUOUn33gr1g4MbSVpRfKLUIi49PSF5cg=";
})
# Fix lots of errors of form:
# include/boost/math/tools/type_traits.hpp:208:12: error: 'is_final' has not been declared in 'std'
(fetchpatch {
name = "luminancehdr-fix-boost-1.87.0-compilation.patch";
url = "https://gitlab.archlinux.org/archlinux/packaging/packages/luminancehdr/-/raw/d5fdbad3c11b6d414d842a7751e858f51292f544/luminancehdr-fix-boost-1.87.0-compilation.patch";
hash = "sha256-bKJhENnOWNwKUUSrSUF9fS1Por1A7exYAeiuCa2fRJY=";
})
# Fix error:
# /build/source/src/Libpfs/manip/gamma_levels.cpp:136:25: error: call of overloaded 'clamp(float, float, float)' is ambiguous
(fetchpatch {
name = "luminancehdr-clamp.patch";
url = "https://gitlab.archlinux.org/archlinux/packaging/packages/luminancehdr/-/raw/d5fdbad3c11b6d414d842a7751e858f51292f544/clamp.patch";
hash = "sha256-iAcZV1lFREPzjA9J3feSdhyTougvQA11I0IQRRYOmxY=";
})
];
env.NIX_CFLAGS_COMPILE = "-I${ilmbase.dev}/include/OpenEXR";
buildInputs = [
libsForQt5.qtbase
libsForQt5.qtdeclarative
libsForQt5.qttools
libsForQt5.qtwebengine
eigen
boost
exiv2
fftwFloat
gsl
ilmbase
lcms2
libraw
libtiff
openexr
];
nativeBuildInputs = [
libsForQt5.wrapQtAppsHook
cmake
pkg-config
];
meta = with lib; {
homepage = "https://qtpfsgui.sourceforge.net/";
description = "Complete open source solution for HDR photography";
license = licenses.gpl2;
platforms = platforms.linux;
maintainers = [ maintainers.hrdinka ];
};
}

View File

@@ -0,0 +1,96 @@
{
lib,
stdenv,
fetchurl,
fetchpatch,
autoreconfHook,
bzip2,
cfitsio,
exiv2,
gettext,
gtk2,
gtkimageview,
lcms2,
lensfun,
libjpeg,
libtiff,
perl,
pkg-config,
zlib,
addThumbnailer ? false,
}:
stdenv.mkDerivation rec {
pname = "nufraw";
version = "0.43-3";
src = fetchurl {
url = "mirror://sourceforge/nufraw/nufraw-${version}.tar.gz";
sha256 = "0b63qvw9r8kaqw36bk3a9zwxc41h8fr6498indkw4glrj0awqz9c";
};
nativeBuildInputs = [
autoreconfHook
gettext
perl
pkg-config
];
buildInputs = [
bzip2
cfitsio
exiv2
gtk2
gtkimageview
lcms2
lensfun
libjpeg
libtiff
zlib
];
configureFlags = [
"--enable-contrast"
"--enable-dst-correction"
];
env.NIX_CFLAGS_COMPILE = "-Wno-narrowing";
postInstall = lib.optionalString addThumbnailer ''
mkdir -p $out/share/thumbnailers
substituteAll ${./nufraw.thumbnailer} $out/share/thumbnailers/${pname}.thumbnailer
'';
patches = [
# Fixes an upstream issue where headers with templates were included in an extern-C scope
# which caused the build to fail
(fetchpatch {
name = "0001-nufraw-glib-2.70.patch";
url = "https://gitlab.archlinux.org/archlinux/packaging/packages/gimp-nufraw/-/raw/3405bc864752dbd04f2d182a21b4108d6cc3aa95/0001-nufraw-glib-2.70.patch";
hash = "sha256-XgzgjikWTcqymHa7bKmruNZaeb2/lpN19HXoRUt5rTk=";
})
]
++ lib.optionals (lib.versionAtLeast exiv2.version "0.28") [
(fetchpatch {
name = "0002-exiv2-error.patch";
url = "https://gitlab.archlinux.org/archlinux/packaging/packages/gimp-nufraw/-/raw/3405bc864752dbd04f2d182a21b4108d6cc3aa95/0002-exiv2-error.patch";
hash = "sha256-40/Wwk1sWiaIWp077EYgP8jFO4k1cvf30heRDMYJw3M=";
})
];
meta = with lib; {
homepage = "https://nufraw.sourceforge.io/";
description = "Utility to read and manipulate raw images from digital cameras";
longDescription = ''
A new version of the popular raw digital images manipulator ufraw.
Forks from the version 0.23 of ufraw (that's why the first nufraw version is the 0.24).
Nufraw offers the same features (gimp plugin, batch, ecc) and the same quality of
ufraw in a brand new improved user interface.
'';
license = licenses.gpl2Plus;
maintainers = with maintainers; [ asbachb ];
platforms = platforms.linux;
};
}

View File

@@ -0,0 +1,4 @@
[Thumbnailer Entry]
TryExec=@out@/bin/nufraw-batch
Exec=@out@/bin/nufraw-batch --silent --size %s --out-type=png --noexif --output=%o --embedded-image %i
MimeType=image/x-canon-cr2;image/x-canon-crw;image/x-minolta-mrw;image/x-nikon-nef;image/x-pentax-pef;image/x-panasonic-rw2;image/x-panasonic-raw2;image/x-samsung-srw;image/x-olympus-orf;image/x-sony-arw

View File

@@ -0,0 +1,44 @@
{
lib,
stdenv,
fetchFromGitHub,
cmake,
qt6Packages,
exiv2,
}:
stdenv.mkDerivation (finalAttrs: {
pname = "pineapple-pictures";
version = "1.2.0";
src = fetchFromGitHub {
owner = "BLumia";
repo = "pineapple-pictures";
rev = finalAttrs.version;
hash = "sha256-QQ0lWYwfCCQUtVQxC6koORiQ3px99+Uy8qHtRx3fbSg=";
};
nativeBuildInputs = [
cmake
qt6Packages.qttools
qt6Packages.wrapQtAppsHook
];
buildInputs = [
qt6Packages.qtsvg
exiv2
];
cmakeFlags = [
"-DPREFER_QT_5=OFF"
];
meta = {
description = "Homebrew lightweight image viewer";
homepage = "https://github.com/BLumia/pineapple-pictures";
license = lib.licenses.mit;
platforms = lib.platforms.linux;
mainProgram = "ppic";
maintainers = with lib.maintainers; [ wineee ];
};
})

View File

@@ -0,0 +1,106 @@
{
stdenv,
lib,
fetchFromGitHub,
libGLU,
qtbase,
qtscript,
qtxmlpatterns,
lib3ds,
bzip2,
muparser,
eigen,
glew,
gmp,
levmar,
qhull,
cmake,
cgal,
boost,
mpfr,
xercesc,
onetbb,
embree,
vcg,
libigl,
corto,
openctm,
structuresynth,
wrapQtAppsHook,
python3Packages,
}:
stdenv.mkDerivation (finalAttrs: {
pname = "pymeshlab";
version = "2023.12";
src = fetchFromGitHub {
owner = "cnr-isti-vclab";
repo = "pymeshlab";
rev = "v${finalAttrs.version}";
hash = "sha256-IOlRdXoUPOJt67g3HqsLchV5aL+JUEks2y1Sy+wpwsg=";
fetchSubmodules = true;
};
buildInputs = [
libGLU
qtbase
qtscript
qtxmlpatterns
lib3ds
bzip2
muparser
eigen
glew
gmp
levmar
qhull
cgal
boost
mpfr
xercesc
onetbb
embree
vcg
libigl
corto
structuresynth
openctm
];
nativeBuildInputs = [
cmake
wrapQtAppsHook
python3Packages.pybind11
];
propagatedBuildInputs = [
python3Packages.numpy
];
preConfigure = ''
substituteInPlace src/meshlab/src/external/libigl.cmake \
--replace-fail '$'{MESHLAB_EXTERNAL_DOWNLOAD_DIR}/libigl-2.4.0 ${libigl}
substituteInPlace src/meshlab/src/external/nexus.cmake \
--replace-fail '$'{NEXUS_DIR}/src/corto ${corto.src}
substituteInPlace src/meshlab/src/external/levmar.cmake \
--replace-fail '$'{LEVMAR_LINK} ${levmar.src} \
--replace-warn "MD5 ''${LEVMAR_MD5}" ""
substituteInPlace src/meshlab/src/external/ssynth.cmake \
--replace-fail '$'{SSYNTH_LINK} ${structuresynth.src} \
--replace-warn "MD5 ''${SSYNTH_MD5}" ""
'';
cmakeFlags = [
"-DCMAKE_INSTALL_PREFIX=${placeholder "out"}/${python3Packages.python.sitePackages}/pymeshlab"
"-DVCGDIR=${vcg.src}"
];
meta = {
description = "Open source mesh processing python library";
homepage = "https://github.com/cnr-isti-vclab/PyMeshLab";
license = lib.licenses.gpl3Only;
maintainers = with lib.maintainers; [ nim65s ];
platforms = with lib.platforms; linux;
};
})

View File

@@ -0,0 +1,144 @@
{
lib,
stdenv,
fetchFromGitHub,
cmake,
pkg-config,
util-linux,
libselinux,
libsepol,
lerc,
libthai,
libdatrie,
libxkbcommon,
libepoxy,
libXtst,
wrapGAppsHook3,
makeWrapper,
pixman,
libpthreadstubs,
gtkmm3,
libXau,
libXdmcp,
lcms2,
libiptcdata,
fftw,
expat,
pcre2,
libsigcxx,
lensfun,
librsvg,
libcanberra-gtk3,
gtk-mac-integration,
exiv2,
libraw,
libjxl,
}:
stdenv.mkDerivation rec {
pname = "rawtherapee";
version = "5.12";
src = fetchFromGitHub {
owner = "RawTherapee";
repo = "RawTherapee";
tag = version;
hash = "sha256-h8eWnw9I1R0l9WAI/DylsdA241qU9NhYGEPYz+JlE18=";
# The developers ask not to use the tarball from Github releases, see
# https://www.rawtherapee.com/downloads/5.10/#news-relevant-to-package-maintainers
forceFetchGit = true;
};
postPatch = ''
cat <<EOF > ReleaseInfo.cmake
set(GIT_DESCRIBE ${version})
set(GIT_BRANCH ${version})
set(GIT_VERSION ${version})
# Missing GIT_COMMIT and GIT_COMMIT_DATE, which are not easy to obtain.
set(GIT_COMMITS_SINCE_TAG 0)
set(GIT_COMMITS_SINCE_BRANCH 0)
set(GIT_VERSION_NUMERIC_BS ${version})
EOF
substituteInPlace tools/osx/Info.plist.in rtgui/config.h.in \
--replace "/Applications" "${placeholder "out"}/Applications"
'';
nativeBuildInputs = [
cmake
pkg-config
wrapGAppsHook3
]
++ lib.optionals stdenv.hostPlatform.isDarwin [
makeWrapper
];
buildInputs = [
util-linux
libselinux
libsepol
lerc
libthai
libdatrie
libxkbcommon
libepoxy
libXtst
pixman
libpthreadstubs
gtkmm3
libXau
libXdmcp
lcms2
libiptcdata
fftw
expat
pcre2
libsigcxx
lensfun
librsvg
exiv2
libraw
libjxl
]
++ lib.optionals stdenv.hostPlatform.isLinux [
libcanberra-gtk3
]
++ lib.optionals stdenv.hostPlatform.isDarwin [
gtk-mac-integration
];
cmakeFlags = [
"-DPROC_TARGET_NUMBER=2"
"-DCACHE_NAME_SUFFIX=\"\""
"-DWITH_SYSTEM_LIBRAW=\"ON\""
"-DWITH_JXL=\"ON\""
]
++ lib.optionals stdenv.hostPlatform.isDarwin [
"-DCMAKE_OSX_DEPLOYMENT_TARGET=${stdenv.hostPlatform.darwinMinVersion}"
];
CMAKE_CXX_FLAGS = toString [
"-std=c++11"
"-Wno-deprecated-declarations"
"-Wno-unused-result"
];
env.CXXFLAGS = "-include cstdint"; # needed at least with gcc13 on aarch64-linux
postInstall = lib.optionalString stdenv.hostPlatform.isDarwin ''
mkdir -p $out/Applications/RawTherapee.app $out/bin
cp -R Release $out/Applications/RawTherapee.app/Contents
for f in $out/Applications/RawTherapee.app/Contents/MacOS/*; do
makeWrapper $f $out/bin/$(basename $f)
done
'';
meta = {
description = "RAW converter and digital photo processing software";
homepage = "http://www.rawtherapee.com/";
license = lib.licenses.gpl3Plus;
maintainers = with lib.maintainers; [
jcumming
mahe
];
platforms = with lib.platforms; unix;
};
}

View File

@@ -0,0 +1,198 @@
{
stdenv,
lib,
fetchFromGitLab,
fetchpatch,
buildPackages,
gettext,
pkg-config,
python3,
avahi,
libgphoto2,
libieee1284,
libjpeg,
libpng,
libtiff,
libusb1,
libv4l,
net-snmp,
curl,
systemdLibs,
withSystemd ? lib.meta.availableOn stdenv.hostPlatform systemdLibs,
libxml2,
poppler,
gawk,
sane-drivers,
nixosTests,
autoconf,
automake,
libtool,
autoconf-archive,
# List of { src name backend } attribute sets - see installFirmware below:
extraFirmware ? [ ],
# For backwards compatibility with older setups; use extraFirmware instead:
gt68xxFirmware ? null,
snapscanFirmware ? null,
# Not included by default, scan snap drivers require fetching of unfree binaries.
scanSnapDriversUnfree ? false,
scanSnapDriversPackage ? sane-drivers.epjitsu,
}:
stdenv.mkDerivation (finalAttrs: {
pname = "sane-backends";
version = "1.4.0";
src = fetchFromGitLab {
owner = "sane-project";
repo = "backends";
tag = finalAttrs.version;
hash = "sha256-e7Wjda+CobYatblvVCGkMAO2aWrdSCp7q+qIEGnGDCY=";
};
# Fix hangs in tests, hopefully
# FIXME: remove in next release
patches = [
(fetchpatch {
url = "https://gitlab.com/sane-project/backends/-/commit/8acc267d5f4049d8438456821137ae56e91baea9.patch";
hash = "sha256-IyupDeH1MPvEBnGaUzBbCu106Gp7zXxlPGFAaiiINQI=";
})
];
postPatch = ''
# Do not create lock dir in install phase
sed -i '/^install-lockpath:/!b;n;c\ # pass' backend/Makefile.am
'';
preConfigure = ''
# create version files, so that autotools macros can use them:
# https://gitlab.com/sane-project/backends/-/issues/440
printf "%s\n" "$version" > .tarball-version
printf "%s\n" "$version" > .version
autoreconf -fiv
# Fixes for cross compilation
# https://github.com/NixOS/nixpkgs/issues/308283
# sane-desc will be used in postInstall so compile it for build
# https://github.com/void-linux/void-packages/blob/master/srcpkgs/sane/patches/sane-desc-cross.patch
patch -p1 -i ${./sane-desc-cross.patch}
'';
outputs = [
"out"
"doc"
"man"
];
depsBuildBuild = [ buildPackages.stdenv.cc ];
nativeBuildInputs = [
autoconf
autoconf-archive
automake
gettext
libtool
pkg-config
python3
];
buildInputs = [
avahi
libgphoto2
libjpeg
libpng
libtiff
libusb1
curl
libxml2
poppler
gawk
]
++ lib.optionals stdenv.hostPlatform.isLinux [
libieee1284
libv4l
net-snmp
]
++ lib.optionals withSystemd [
systemdLibs
];
enableParallelBuilding = true;
configureFlags = [
"--with-lockdir=/var/lock/sane"
]
++ lib.optionals (avahi != null) [ "--with-avahi" ]
++ lib.optionals (libusb1 != null) [ "--with-usb" ];
# autoconf check for HAVE_MMAP is never set on cross compilation.
# The pieusb backend fails compilation if HAVE_MMAP is not set.
buildFlags = lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) [
"CFLAGS=-DHAVE_MMAP=${if stdenv.hostPlatform.isLinux then "1" else "0"}"
];
postInstall =
let
compatFirmware =
extraFirmware
++ lib.optional (gt68xxFirmware != null) {
src = gt68xxFirmware.fw;
inherit (gt68xxFirmware) name;
backend = "gt68xx";
}
++ lib.optional (snapscanFirmware != null) {
src = snapscanFirmware;
name = "your-firmwarefile.bin";
backend = "snapscan";
};
installFirmware = f: ''
mkdir -p $out/share/sane/${f.backend}
ln -sv ${f.src} $out/share/sane/${f.backend}/${f.name}
'';
in
''
mkdir -p $out/etc/udev/rules.d/ $out/etc/udev/hwdb.d
./tools/sane-desc -m udev+hwdb -s doc/descriptions:doc/descriptions-external > $out/etc/udev/rules.d/49-libsane.rules
./tools/sane-desc -m udev+hwdb -s doc/descriptions:doc/descriptions-external -m hwdb > $out/etc/udev/hwdb.d/20-sane.hwdb
# net.conf conflicts with the file generated by the nixos module
rm $out/etc/sane.d/net.conf
''
+ lib.optionalString scanSnapDriversUnfree ''
# the ScanSnap drivers live under the epjitsu subdirectory, which was already created by the build but is empty.
rmdir $out/share/sane/epjitsu
ln -svT ${scanSnapDriversPackage} $out/share/sane/epjitsu
''
+ lib.concatStrings (map installFirmware compatFirmware);
# parallel install creates a bad symlink at $out/lib/sane/libsane.so.1 which prevents finding plugins
# https://github.com/NixOS/nixpkgs/issues/224569
enableParallelInstalling = false;
doInstallCheck = true;
passthru.tests = {
inherit (nixosTests) sane;
};
meta = {
description = "SANE (Scanner Access Now Easy) backends";
longDescription = ''
Collection of open-source SANE backends (device drivers).
SANE is a universal scanner interface providing standardized access to
any raster image scanner hardware: flatbed scanners, hand-held scanners,
video- and still-cameras, frame-grabbers, etc. For a list of supported
scanners, see http://www.sane-project.org/sane-backends.html.
'';
homepage = "http://www.sane-project.org/";
license = lib.licenses.gpl2Plus;
platforms = lib.platforms.linux ++ lib.platforms.darwin;
maintainers = [ lib.maintainers.symphorien ];
};
})

View File

@@ -0,0 +1,12 @@
--- a/tools/Makefile.in
+++ b/tools/Makefile.in
@@ -586,7 +586,7 @@ gamma4scanimage$(EXEEXT): $(gamma4scanimage_OBJECTS) $(gamma4scanimage_DEPENDENC
sane-desc$(EXEEXT): $(sane_desc_OBJECTS) $(sane_desc_DEPENDENCIES) $(EXTRA_sane_desc_DEPENDENCIES)
@rm -f sane-desc$(EXEEXT)
- $(AM_V_CCLD)$(LINK) $(sane_desc_OBJECTS) $(sane_desc_LDADD) $(LIBS)
+ cc -I. sane-desc.c -I../include ../sanei/sanei_config.c ../sanei/sanei_init_debug.c ../sanei/sanei_constrain_value.c -o $@
sane-find-scanner$(EXEEXT): $(sane_find_scanner_OBJECTS) $(sane_find_scanner_DEPENDENCIES) $(EXTRA_sane_find_scanner_DEPENDENCIES)
@rm -f sane-find-scanner$(EXEEXT)

View File

@@ -0,0 +1,55 @@
{ lib, stdenv }:
{
paths,
disabledDefaultBackends ? [ ],
}:
let
installSanePath = path: ''
if [ -e "${path}/lib/sane" ]; then
find "${path}/lib/sane" -maxdepth 1 -not -type d | while read backend; do
symlink "$backend" "$out/lib/sane/$(basename "$backend")"
done
fi
if [ -e "${path}/etc/sane.d" ]; then
find "${path}/etc/sane.d" -maxdepth 1 -not -type d | while read conf; do
name="$(basename $conf)"
if [ "$name" = "dll.conf" ] || [ "$name" = "saned.conf" ] || [ "$name" = "net.conf" ]; then
cat "$conf" >> "$out/etc/sane.d/$name"
else
symlink "$conf" "$out/etc/sane.d/$name"
fi
done
fi
if [ -e "${path}/etc/sane.d/dll.d" ]; then
find "${path}/etc/sane.d/dll.d" -maxdepth 1 -not -type d | while read conf; do
symlink "$conf" "$out/etc/sane.d/dll.d/$(basename $conf)"
done
fi
'';
disableBackend = backend: ''
grep -w -q '${backend}' $out/etc/sane.d/dll.conf || { echo '${backend} is not a default plugin in $SANE_CONFIG_DIR/dll.conf'; exit 1; }
sed -i 's/\b${backend}\b/# ${backend} disabled by nixos config/' $out/etc/sane.d/dll.conf
'';
in
stdenv.mkDerivation {
name = "sane-config";
dontUnpack = true;
installPhase = ''
function symlink () {
local target=$1 linkname=$2
if [ -e "$linkname" ]; then
echo "warning: conflict for $linkname. Overriding $(readlink $linkname) with $target."
fi
ln -sfn "$target" "$linkname"
}
mkdir -p $out/etc/sane.d $out/etc/sane.d/dll.d $out/lib/sane
''
+ (lib.concatMapStrings installSanePath paths)
+ (lib.concatMapStrings disableBackend disabledDefaultBackends);
}

View File

@@ -0,0 +1,13 @@
{ lib, fetchFromGitHub }:
{
# Fujitsu ScanSnap
epjitsu = fetchFromGitHub {
name = "scansnap-firmware";
owner = "stevleibelt";
repo = "scansnap-firmware";
rev = "96c3a8b2a4e4f1ccc4e5827c5eb5598084fd17c8";
sha256 = "1inchnvaqyw9d0skpg8hp5rpn27c09q58lsr42by4bahpbx5qday";
meta.license = lib.licenses.unfree;
};
}

View File

@@ -0,0 +1,80 @@
{
lib,
stdenv,
fetchurl,
fetchpatch,
sane-backends,
libX11,
gtk2,
pkg-config,
libusb-compat-0_1 ? null,
}:
stdenv.mkDerivation rec {
pname = "sane-frontends";
version = "1.0.14";
src = fetchurl {
url = "https://alioth-archive.debian.org/releases/sane/${pname}/${version}/${pname}-${version}.tar.gz";
sha256 = "1ad4zr7rcxpda8yzvfkq1rfjgx9nl6lan5a628wvpdbh3fn9v0z7";
};
# add all fedora patchs. fix gcc-14 build among other things
# https://src.fedoraproject.org/rpms/sane-frontends/tree/main
patches =
let
fetchFedoraPatch =
{ name, hash }:
fetchpatch {
inherit name hash;
url = "https://src.fedoraproject.org/rpms/sane-frontends/raw/89f752d7e236e86be8d64b7ac6991a36f9e9f7d0/f/${name}";
};
in
map fetchFedoraPatch [
{
name = "0001-src-scanadf.c-Fix-segfault-when-scanadf-h-d-device.patch";
hash = "sha256-sSUWm5fL7YTebzXh3Thb/qwgr7d++1Y+74uI8R5oF0g=";
}
{
name = "frontends-scanadf-segv.patch";
hash = "sha256-VRag9nMk8ZCjg9Oq0siHdT8J6sbNjq9cU2ktOH2vkLo=";
}
{
name = "sane-frontends-1.0.14-array-out-of-bounds.patch";
hash = "sha256-a0lzbAogSrXsK5jVeNffDS+zFxpuDHXpHQlOJ5874+U=";
}
{
name = "sane-frontends-1.0.14-sane-backends-1.0.20.patch";
hash = "sha256-ViYjxXGj58P6EaZ+fIiAydrgbyS1ivn39uN3EWcvnZg=";
}
{
name = "sane-frontends-1.0.14-xcam-man.patch";
hash = "sha256-HGANgQPujn/jjOMGs9LlzYvYZphMWwbsI74NCad5ADc=";
}
{
name = "sane-frontends-c99.patch";
hash = "sha256-LPELEG11wEom05ECAMgXUDRWvrbuU4nT3apuS1eITyA=";
}
{
name = "sane-frontends-configure-c99.patch";
hash = "sha256-SPvMDCZv8VRGP+cXRFjVbqgbTeVhdLOTEQbbBgSMLvY=";
}
];
buildInputs = [
sane-backends
libX11
gtk2
]
++ lib.optional (libusb-compat-0_1 != null) libusb-compat-0_1;
nativeBuildInputs = [ pkg-config ];
enableParallelBuilding = true;
meta = with lib; {
description = "Scanner Access Now Easy";
homepage = "http://www.sane-project.org/";
license = licenses.gpl2Plus;
platforms = platforms.linux;
};
}

View File

@@ -0,0 +1,45 @@
{
lib,
stdenv,
fetchFromGitHub,
cmake,
libsForQt5,
libjpeg,
libpng,
libtiff,
boost,
}:
stdenv.mkDerivation rec {
pname = "scantailor-advanced";
version = "1.0.19";
src = fetchFromGitHub {
owner = "vigri";
repo = "scantailor-advanced";
rev = "v${version}";
sha256 = "sha256-mvoCoYdRTgXW5t8yd9Y9TOl7D3RDVwcjUv2YDUWrtRI=";
};
nativeBuildInputs = [
cmake
libsForQt5.wrapQtAppsHook
libsForQt5.qttools
];
buildInputs = [
libjpeg
libpng
libtiff
boost
libsForQt5.qtbase
];
meta = with lib; {
homepage = "https://github.com/vigri/scantailor-advanced";
description = "Interactive post-processing tool for scanned pages (vigri's fork)";
mainProgram = "scantailor";
license = licenses.gpl3Plus;
maintainers = [ ];
platforms = with platforms; gnu ++ linux ++ darwin;
};
}

View File

@@ -0,0 +1,52 @@
{
lib,
stdenv,
fetchFromGitHub,
cmake,
libsForQt5,
zlib,
openjpeg,
libjpeg_turbo,
libpng,
libtiff,
boost,
libcanberra,
}:
stdenv.mkDerivation rec {
pname = "scantailor-universal";
version = "0.2.14";
src = fetchFromGitHub {
owner = "trufanov-nok";
repo = "scantailor-universal";
rev = version;
fetchSubmodules = true;
hash = "sha256-n8NbokK+U0FAuYXtjRJcxlI1XAmI4hk5zV3sF86hB/s=";
};
buildInputs = [
libsForQt5.qtbase
zlib
libjpeg_turbo
libpng
libtiff
boost
libcanberra
openjpeg
];
nativeBuildInputs = [
cmake
libsForQt5.wrapQtAppsHook
libsForQt5.qttools
];
meta = with lib; {
description = "Interactive post-processing tool for scanned pages";
homepage = "https://github.com/trufanov-nok/scantailor";
license = licenses.gpl3Plus;
maintainers = with maintainers; [ unclamped ];
platforms = platforms.unix;
mainProgram = "scantailor-universal-cli";
};
}

View File

@@ -0,0 +1,47 @@
{
lib,
stdenv,
fetchFromGitHub,
libXft,
imlib2,
giflib,
libexif,
conf ? null,
}:
stdenv.mkDerivation rec {
pname = "sxiv";
version = "26";
src = fetchFromGitHub {
owner = "muennich";
repo = "sxiv";
rev = "v${version}";
sha256 = "0xaawlfdy7b277m38mgg4423kd7p1ffn0dq4hciqs6ivbb3q9c4f";
};
configFile = lib.optionalString (conf != null) (builtins.toFile "config.def.h" conf);
preBuild = lib.optionalString (conf != null) "cp ${configFile} config.def.h";
buildInputs = [
libXft
imlib2
giflib
libexif
];
makeFlags = [ "PREFIX=${placeholder "out"}" ];
postInstall = ''
install -Dt $out/share/applications sxiv.desktop
'';
meta = with lib; {
description = "Simple X Image Viewer";
homepage = "https://github.com/muennich/sxiv";
license = lib.licenses.gpl2Plus;
platforms = lib.platforms.linux;
maintainers = with maintainers; [ h7x4 ];
mainProgram = "sxiv";
};
}

View File

@@ -0,0 +1,31 @@
{
callPackage,
lowPrio,
}:
let
base3 = callPackage ./tesseract3.nix { };
base4 = callPackage ./tesseract4.nix { };
base5 = callPackage ./tesseract5.nix { };
languages = callPackage ./languages.nix { };
in
{
tesseract3 = callPackage ./wrapper.nix {
tesseractBase = base3;
languages = languages.v3;
};
tesseract4 = lowPrio (
callPackage ./wrapper.nix {
tesseractBase = base4;
languages = languages.v4;
}
);
tesseract5 = lowPrio (
callPackage ./wrapper.nix {
tesseractBase = base5;
languages = languages.v4;
}
);
}

View File

@@ -0,0 +1,35 @@
#!/usr/bin/env bash
# Usage:
# ./fetch-language-hashes <tessdataRev> [<language code>…]
#
# Fetches all languages if no language codes are given.
#
# Example:
# ./fetch-language-hashes 4.0.0 eng spa
#
# Output:
# eng = "0iy0...";
# spa = "15kw...";
set -e
(( $# >= 1 )) || exit 1
tessdataRev=$1
shift
if (( $# > 0 )); then
langCodes="$@"
else
repoPage=$(curl -fs https://github.com/tesseract-ocr/tessdata/tree/$tessdataRev || {
>&2 echo "Invalid tessdataRev: $tessdataRev"
exit 1
})
langCodes=$(echo $(echo "$repoPage" | grep -ohP "(?<=/)[^/ ]+?(?=\.traineddata)" | sort -u))
fi
for lang in $langCodes; do
url=https://github.com/tesseract-ocr/tessdata/raw/$tessdataRev/$lang.traineddata
hash=$(nix --extra-experimental-features nix-command hash to-sri --type sha256 $(nix-prefetch-url $url 2>/dev/null))
echo "$lang = \"$hash\";"
done

View File

@@ -0,0 +1,303 @@
{
stdenv,
lib,
fetchurl,
fetchFromGitHub,
}:
rec {
makeLanguages =
{
tessdataRev,
tessdata ? null,
all ? null,
languages ? { },
}:
let
tessdataSrc = fetchFromGitHub {
owner = "tesseract-ocr";
repo = "tessdata";
rev = tessdataRev;
hash = tessdata;
};
languageFile =
lang: hash:
fetchurl {
url = "https://github.com/tesseract-ocr/tessdata/raw/${tessdataRev}/${lang}.traineddata";
inherit hash;
};
in
{
# Use a simple fixed-output derivation for all languages to increase nix eval performance
all = stdenv.mkDerivation {
name = "all";
buildCommand = ''
mkdir $out
cd ${tessdataSrc}
cp *.traineddata $out
'';
outputHashMode = "recursive";
outputHashAlgo = "sha256";
outputHash = all;
};
}
// (lib.mapAttrs languageFile languages);
v3 = makeLanguages {
tessdataRev = "3cf1e2df1fe1d1da29295c9ef0983796c7958b7d";
tessdata = "sha256-591NFrPdZ9orB9PtxKqsukh6aAq5DDO8yJ19W/Ywi+w=";
all = "sha256-FuIGfE0bNPvB8ip6cL8GRl0U9T7oD6sx+38CaGyCRno=";
# Run `./fetch-language-hashes <tessdataRev>` to generate these hashes
languages = {
afr = "sha256-birhlXVhETYI4SYipFROA0xGpJtvnEqjEVGlSPy3upU=";
amh = "sha256-BJ73M3RYuc7ZuLBLr52GLilxdA9mUhXkUK9vPXDTbPE=";
ara = "sha256-IcmKr3rroicawMxKNj02TYBmSdfLC8q4XUuaOF9JZFo=";
asm = "sha256-0LW2Utq5Resb+MKweGRxLHwzQXLDaqHJ6QfD60vAfDA=";
aze = "sha256-vCtISRgsNyDAmEf1pkXR40gawizvUahZUKFP3OE44F8=";
aze_cyrl = "sha256-uFMD0kJq6x0Ho2ofBvd5pghZMzbmgCuslmx6JPpzSzY=";
bel = "sha256-QvPRVfIO6TNpeKrOZD14FM4JJUfXXWXwVMyBGTfy+BM=";
ben = "sha256-FXgmuvSAY1R7d5PhveDJ+C1IQ0iPtcfgIVX2YqcI6GA=";
bod = "sha256-Vql4san2bCVfcUVEG6YHdXIWfhkluAV0R9r9n0Y5mGc=";
bos = "sha256-5J2i7uhl7cHYHW6izqvAvb638nW22Hj7O2R0emQjIOM=";
bul = "sha256-ygvSU7SrYgLbXoss7LxCGbT3JeUUaMq/W8mTOOLD3jM=";
cat = "sha256-Ka9nRn7Bsf/U0tl0jwIZ8iIJdLDlOmbscjTxdotD/E0=";
ceb = "sha256-wSEDsspJiHLcctcemjMAZjU6zSx1is4dP1nBTa4lNrw=";
ces = "sha256-YMWOzZeHWkHsyuSEai5L90yw5LwGbRvEMJGcdqGfs38=";
chi_sim = "sha256-MjrnTUov9J6TLbtNYoL+Dmfd+v2gdeyFgD7NB3IHRUw=";
chi_tra = "sha256-d01Wa9CzbktsB0Fd+ltrV/6yV1sfXyMdf+AaUtrF3Q4=";
chr = "sha256-i7IPinjjGkgC+p8eB1y33o18LqxbezOUKm2Cq+B4Osw=";
cym = "sha256-B8jj1qE5cR3NtMkvkNGIAvbhXeOTMViNcT/nypJb3DQ=";
dan = "sha256-+VIag4GrGCO+CAj5M6m7jxFylopE45HjcLH+m02RPug=";
dan_frak = "sha256-cYNhenunY/WcHth+vItIhdoDqbuiuZ1GAK+sWP0osa8=";
deu = "sha256-y360Kn6XLOx++QT+gYJde1R8Rt9oTIFP2xGpMLE7yjo=";
deu_frak = "sha256-y7IA45RIXFtRXeIDljwqdsFL3vLPJYIZ7PK8rPbMk/g=";
dzo = "sha256-tR/wbc8wEjWfqoIcPSReTIofS2WuX2FOSrH/E2sEn7k=";
ell = "sha256-u+DtB1jGkEMRSxP8jwCkI0LGR/J741LAW0l44mU4DmQ=";
eng = "sha256-wFFcnx4MeeEGn8wFwrL2poQfteEILWldsWAzPBFU8G0=";
enm = "sha256-hliaWydvYxeD4DhyNkD/JAYIixdivVw+ftcHPnYPxoM=";
epo = "sha256-xCTSmiNBRpNT//JfRmtn3jkEFWvBUXwqG6OzVUuBtPg=";
equ = "sha256-OvQ6JCDOkn285oR01kRiWUcYmoLOauT9MhBjmRRoGds=";
est = "sha256-j6jyZJrjFok4lnlTzjrLwZ2MDgcCjARhwppJGDBFlIo=";
eus = "sha256-3Jo0mQQMYA6sBwNiabvBauHlhFyrMuG2Jypwem5Nmgw=";
fas = "sha256-XUZC4yxm6UULypwM7SLK6TGINArP2MbKcX8C5he5wVQ=";
fin = "sha256-+DDGJfY1pjfLEaalZRJrGuEFwkrp/Xy5LI1RMMcYTPE=";
fra = "sha256-hq+yOtFGRn8mPoreVv05UbHMKPjE7rw0+ZPTwC2Ip6s=";
frk = "sha256-t0UWINMKPabRxryZiwiplt++USa4lh7mJuKMdMPJ1Zo=";
frm = "sha256-trW44scT9PZqr2+Vb7dh6oxlGLkq9MURpiozfj4c3wM=";
gle = "sha256-6n4lfOjP5yJ5UFoVTB1VyhBoeAS7/PdpRsLUYutEH9k=";
glg = "sha256-X5AhWWqOUwYWWhNCnNFtJ9UXYFZ0wV1p5XEwer2Ktjk=";
grc = "sha256-q9sWDD0MNCTjVPFUWRmL/KRw3EK2o5TKUh53hkcKIhM=";
guj = "sha256-VAUO0X64PQ4lihJ9kjCLA3zeNAKFgdfQ4qkDVzut6DY=";
hat = "sha256-aIsDZWV2q8ffaG9OT6y3h5j/Gd0NygECYgms1WmtIx0=";
heb = "sha256-T3koiv3pFi7ieEHw3pmeaQAizx470XI+NMqPGJxL6ps=";
hin = "sha256-bplFnb3MQL/sEydHvCMwVJFr7Z2gL4lWfJOIwy4v1u4=";
hrv = "sha256-w3oh7zZ4gBP3GpG6ZJ9K3EwP+O7Z6LKoqm2JHbtpOJc=";
hun = "sha256-pnBNLo2uYiQFlzQsM3Ns172DaojhiPx02wOOyHvj/6c=";
iku = "sha256-q4GeYBOPhDJQiLEZcxe14hAjLywQRrKeZB6TFALbPuw=";
ind = "sha256-NzjesAe6+fAbOmAYNQA/ccMU0blV+KdDY09vHsgiDYg=";
isl = "sha256-v2tsHHb4vLn3gNwXLYth02X6tDSxXoQnfc1s19B8dgA=";
ita = "sha256-Wk5ugm4CHQTzSUwr107Rr1l3tn/e3Os8mqMP9seks9M=";
ita_old = "sha256-P9C5+JRtoRTt7weyQv0RvGhoQjvBI+aZD+qG4oNfD6E=";
jav = "sha256-d/G12l/6oJZyTsNpmuTb/en4VE9LdLtcLJpCJu2XXro=";
jpn = "sha256-PDyVfLv7b+ZrOLRrwX+GFY39sWiKKijt5+4OyJH0qvI=";
kan = "sha256-bxsg1jOTODXA7K7OQuZMYf1pDsAQ0N9S24lDPkoiU0E=";
kat = "sha256-I9aIBop6SWlLEMh7cl44nJ3Mxm5w61KtNqztzU4BYJo=";
kat_old = "sha256-0GWX+Xp1f1Ghw2P0v3PSck3sntwdS8f/9vSi0Uo59Ak=";
kaz = "sha256-9WmAKI6bkL/rGSkXV9oLKT09UAYbCDE184qX/w83g0E=";
khm = "sha256-WoT8I+5T24WLygalGpoWZhlykZGO4J54+q7ghsu2Yr0=";
kir = "sha256-A0J7mgB7dK/OObXQJhtP5vZHbjZn3k6gwxhFjM2zMaw=";
kor = "sha256-+zEuvhGadnPKaMCp97nd0TpwT2RgndIvL9YGiJyRjeY=";
kur = "sha256-LIZeBRn+W4/eC24hhHRcnAbsluuT+xP7fsKYZ5q74rI=";
lao = "sha256-rr8gJe4exxsO5TKCWCjQ0tStp/t/Wb1TXuv2OlVXbQ0=";
lat = "sha256-Up/0i6rZ0QERaYnJj/MJRoYdO21LpkPFTMpebnM7++A=";
lav = "sha256-Tx8GN29JjQ2uEfsDIA7hJMYV3ISP7hwFr/kYe/j2vzs=";
lit = "sha256-FYpSd1cvBLufsHCjvACtOl/npeJYVsn5JIlmLOV7ADg=";
mal = "sha256-CnWrck61tl1tPtBfj/d+qfzyrKd/i3QR1qYOGyG9A8U=";
mar = "sha256-Mzbn1UBQf7btrpmJPlqphsPTZWKJFrszS+AM6kfBxys=";
mkd = "sha256-4/QQaE6Q3HNF7CbvuCZ227AfKx7kY++1/i1IkllTPOA=";
mlt = "sha256-EGgCdZh/8WtJQ3IdSa7LzUq56eNCDJ77oWGqpaDZ5OI=";
msa = "sha256-0vfS1XrxrIZocDBE9IDleMMf7QNx7aKTBiT/1Gc1FxE=";
mya = "sha256-VKDRg9eramczalBJKPPfibTJeB02CDJa3H8K0lbJ3p4=";
nep = "sha256-DMvPyc9L5a1XX2hdH2MXa3c+7np7snAt27VpMXI5g5Q=";
nld = "sha256-vYSTRehHb0e0DBcgT+9c9kKHJEwZudF+KX/+cPxcnLI=";
nor = "sha256-qZAmnz2BWtIG6g8nsU0H56C+DBcTNTl7wLRuoM3P2/o=";
ori = "sha256-TCliwoXMw8c14DHvMnGc84Vh12xcsD7LNxpy+xCbSjc=";
osd = "sha256-nPXVdvzEdWTxEmWEHlyoOQAefm84/396rPRtFalrAP8=";
pan = "sha256-e1UefVLiddjb3uUoAWrLIovwE7Ifz8dzM7m65ie/jbs=";
pol = "sha256-HSKSMZ0uPGXhXxn1W5Ycm0kmUfwXnzvNIZr/58FBv5Q=";
por = "sha256-CJ+0Gc170TUjYkTdmkuKQt/i7pfZe0ge/de5LJxjJKA=";
pus = "sha256-q4hOL9P/cir/tmGSfhjnULSQUucxy7BeosFu94O15cc=";
ron = "sha256-9PNhTUsAnusKtYFevvCA67p8Rws/gMn5ftbaDT9AmYY=";
rus = "sha256-GADcrwQ+lQByafBxaKEiWM2Lh79BN2nCtaPVRR5FyrQ=";
san = "sha256-b0ylBT8U4W2nDuO26w5VS4W9X9uO0+ya8ylZ/qQiLpk=";
sin = "sha256-9YU8Nu/e2xQhmMpokdCidz6in1THamCJM9I4k1F4IZA=";
slk = "sha256-ul0qugn1nhlSWDgl3XsOubpwYoPRwPk76Nc4G15eri8=";
slk_frak = "sha256-Hn8eWerSShNtwGJumAGVlKBC5iCHv8+PD92z4oO12H8=";
slv = "sha256-MFiE4VGgFCHoR6SjDwXpyJn879SDoS0uqODyBVNNVs4=";
spa = "sha256-8jmFmWu8/itXhkzLCCeDwcdMh0KfBEEaBKa6TT2i79o=";
spa_old = "sha256-XaOG/YRQhpbjrmPQo13Oe1JtW2aZSU/lOtZTh/bckXA=";
sqi = "sha256-rs21rvcLz/o6UAZ2kQ/eHStdY3hHlgmcP92Pig3cn5c=";
srp = "sha256-Nb/rPOFPWv64LJviSQ2zQXjA4T996AYQE6CDsWPGdBU=";
srp_latn = "sha256-mVvApX5lqdQgkhESLm3PCuMR7v526aFE0wgrYPDQSGs=";
swa = "sha256-jhCnJU532THt+MkzqYvls2q+H9IcMmbAZkHgRk+HnN8=";
swe = "sha256-KmQHu/GH6x/P0WM/rpq//NYiDnq3TgXmW/FkJqyPIFA=";
syr = "sha256-YD3JPEm4bP9OHcXcnA15D7/rj/ZM9rUhgeV6PgKNfSE=";
tam = "sha256-f7c0foBtVA74PrnEJt3iNmommjcPEf/+c5ILtfwsJbw=";
tel = "sha256-+0btVJoVYzve8ad2sjQxSkQzNOlnjPUVrtUsUhbLzTs=";
tgk = "sha256-QPOySbwYy3WHvDqvs4BDXROpTJVgOzGCP5L7mN0Z0jg=";
tgl = "sha256-55SvYHQmJpuzLu2y8gcG4nj7sA5KdcQ9xKe4yOIDOTg=";
tha = "sha256-ykpC1Egb0Dd80CcxtRScIov3Pot6YeRLmi1eJ0vhUPg=";
tir = "sha256-EKWKtn1ibgk5KOYCBW5ek/RsKT5fygI9UWygLKHP8fg=";
tur = "sha256-XLzOXvtms9oQoUOX+8OojYRXufG3JLnI2WRJsVLCFnc=";
uig = "sha256-uy+C97n4OqtNP62AYDF0q4TmaIkfnhbaHGPRX0Jurek=";
ukr = "sha256-L4ss0PC1uGEqS4CrzrqjrEb18DaJJmKbPP9Xa52VvDE=";
urd = "sha256-KDB7+JK4jDhWxMexkiE+qGh5np8MROXL5dpRoX+wrIM=";
uzb = "sha256-NJE0a17k3P25IUSimi8JB/IdHncrX/7KlqXrbWRpc8o=";
uzb_cyrl = "sha256-pSBiXV3h8Aia+DbABLLPvT/lpQhEAeTpaFjUl9FQsc0=";
vie = "sha256-zvXmN0fIbiG8u9MLtoOhsQT5gpO3SyqJF0hw1btEQck=";
yid = "sha256-zZm4mvPApL0hpD3UPxN+/96j3V0ZrVk+ALvUih5orck=";
};
};
v4 = makeLanguages {
tessdataRev = "4.1.0";
tessdata = "sha256-70bp4prs1zUbSzQmcqd7v736cyYWv8oNNbmZXypik5I=";
all = "sha256-hk+DjoVWf7RW9S+Gu9XUX8aWYYsL5dU5c6jLSKJp+MY=";
# Run `./fetch-language-hashes <tessdataRev>` to generate these hashes
languages = {
afr = "sha256-XsQc6+0/SheO6dcuERKsmko4p7DdyvsSZtVdne1FLqk=";
amh = "sha256-QIoWQufDlggA/5P5SyxmwSdQZhgXqIyFq/OULrtvO1Q=";
ara = "sha256-IAWXZ3i7wU/Fak6o1DxggIR67ucvzCIBSI8kDayhXFs=";
asm = "sha256-juqmGgEUh8NphXBfnlZ+LELcUQ88Q8OYaZ5nJvNOrQg=";
aze = "sha256-7mkrPPlvOXe5FVbwgaz7sLjEQhfEj4t8HbYbhY5mUAc=";
aze_cyrl = "sha256-bwdsYITvHB6RyRdRmSiN0dme6QUS2SignDafXGJCbek=";
bel = "sha256-DFkWfO4s/KJmPr9NKNICeypRx1MHk0MQVfx71nX1HjY=";
ben = "sha256-YCO2Ign/zAiUUngauWMUT3shzqePYdHPsNmNSQJJ+Cg=";
bod = "sha256-Wc3pXuVwN/sQl3S6kUe4lEP0ToRIMtaoydFAaknpB2Y=";
bos = "sha256-zY74ANUNk704ni8LAaViWpqjpST/7qRE6BQWYCyp/us=";
bre = "sha256-M2cbvdi0oVzq18AEdMxyFmndEvyXT0m4psv+SBAjDhw=";
bul = "sha256-kvd9UV+2rkcrI5rQnQwE0GU5wkBIJD8IzejRdLgXbw0=";
cat = "sha256-Gx/vnnDYzpug7JLVBxQsjcV/QP1vsAOcE94jqUIyuqc=";
ceb = "sha256-OR2KxjF5M8HTzuVqDutFF0QhgLV5S2iqVYRhGIjdJqE=";
ces = "sha256-zoYe0dwg5020ScRjbUSoMELNKuuM2VyQCCk7XQ95Ajo=";
chi_sim = "sha256-/AXYmrMdi04iaRDxaovL945DuuPiWAu1/u/QUu/as2M=";
chi_sim_vert = "sha256-hyNJp2YWhVDeLoSrPwOCegSXVvphfaH6Fki11fe/5bg=";
chi_tra = "sha256-VZBn3A98lHiIhHQhKdZqARfd5/T/ErJj2SFHFzSX2xQ=";
chi_tra_vert = "sha256-hGJKlSn650+h69dGyAl1gh9wPYIamPcon0WFx3xjiYE=";
chr = "sha256-1BAbYlHTt6/Kr+S5IDoqWSQd6WS3E6ZlGycdwYxCGKc=";
cos = "sha256-3dPsVxypXXNMP5+hOTMHRXmOAFK0Q8UuALZAxGHoM30=";
cym = "sha256-TUCW6JEQWoU4jm1Jo5tRNTQvthLf0TX+wr0P4i5L844=";
dan = "sha256-Ii+1rRqxMffokBlD1uOo5zOvMNs2wu8h5Nr73aGqOco=";
dan_frak = "sha256-AFbqCzSZD7rGCXyQyResnEhVgNKvdAsZPvav2nF7jJ8=";
deu = "sha256-iWs7SVZQOrnaoQKF2zMIgbLXS3DYibeSYsxTS57GmaQ=";
deu_frak = "sha256-p649BhD51E1V3QbCquokQd9UI68FXCm4O6wEJ8aFEIo=";
div = "sha256-gXx/fy6jvdvDjgrMjzpXt03BaqoehOcvJkzDDktOtSY=";
dzo = "sha256-K/AnF2DDwn8z6L3hMJS0B2guCY/mUl1/8fh9xV5mZ/4=";
ell = "sha256-D2uLRAmE/pFYAZ1yLGJPMqYuD5myHyJHSSGQpFCoHsI=";
eng = "sha256-2qDJfWUcGfujsl6BMXzWl+mQjIIICQyUw5BTgcI/wEc=";
enm = "sha256-dXtF3SVXfG4Xo/j45IWvoy5diImsTD4IjQsNGjcOGbY=";
epo = "sha256-yRIyCVJRzisB16vfmP7bYAU5XvRY9y0G5xsUcFYjL8o=";
equ = "sha256-j2YDI9int6Do0vrho0OebkcCIr+7mQsqt/6eH7R5HAs=";
est = "sha256-9KGCAXcFltDbv7sWOFTAwBQzkWlV1pXjcscv46F6vss=";
eus = "sha256-tyZYz8/JGp+gA6ZIvTNAKU6d3EKa5rwVQAZFfao9UTE=";
fao = "sha256-CnHutxfwLTEo1s2UZ86ApCnBlRzPf+rXVH+h4CQZZNg=";
fas = "sha256-CzsV6cy+Q1glGH+norsif1Vd03z4USbGz0WcpKabkp8=";
fil = "sha256-H65YA5/Mj1Y1dXmhCgSeJcaOewhBW4LGT64d8dAc4Vw=";
fin = "sha256-T6zqajTwlK8megAusSaVRyx5NjtyusIEEyufam3yg/E=";
fra = "sha256-6sAcHXJUDWCQ+st7L0LdCi7o/FfFvhsgVIrmaOJ2GRM=";
frk = "sha256-18fZ/9zd1naVD+SYLIcz7UrbY73NxO8lLLRh2XuvmBU=";
frm = "sha256-wm9GwlmBr2Ia87ipNm09NgP2r/JVfrv/opuCBo33Bik=";
fry = "sha256-8BRoZ3OCITSfjKxNPPVlC2ZmDaaEXg+pTXlSmB7KBEU=";
gla = "sha256-WU0FUhx4ajDD4V6EtXcH/nDlSJm6oWVb+ooXUBb0LZ4=";
gle = "sha256-s3ZdQ5gYnlkswhUH6WnztMGEDYWjETPeJUVt9n+BB+E=";
glg = "sha256-5AENqozozcDbPmJsbn7WgvFg1LKDRFI1UMNfmMPXugc=";
grc = "sha256-1L/cwkD6HoeFM114D9zwYUohAVVpCS8CLI+TXvXQoAM=";
guj = "sha256-pIT0pwAv9Ooi3KJoIeQEMTE6Mc1CmrkJASJ+YJ8jGwk=";
hat = "sha256-WkPgMxD5cpv4NeDCYgpaslX3TL6HMc+p9JaJfE0oiq0=";
heb = "sha256-fabqa3omIOyOi0HeKWehPUKWNaVmV6CzC2IlAaVz0+E=";
hin = "sha256-zHbQn6T+0cekZ0BG4l5jdg0Mm/3OOQpSETRiw0pVbuY=";
hrv = "sha256-91VXBv5BFRUBiIMYeoC/eNzWruTMT7zoT4xnMKtZRzU=";
hun = "sha256-sSf5igeLuCT2JS1SMgfZBer3TwACwnTrx5+cm2wlWnA=";
hye = "sha256-Lvd3XbnEExINu4aOQMgJEVUSnLFB1js3gXJRXg6q30U=";
iku = "sha256-trY4sUGfNkP4gZaMWQ84hf1CddguuYs8W7CvLtC2WaU=";
ind = "sha256-Ra2q3ocV9VPBCDNPYD8k5LyQL8Z2OJK1qSRa/iMMgrQ=";
isl = "sha256-+CIAk5r5SrZ2wdXhXG01wflpRu684PhBSgqnLCbiUsI=";
ita = "sha256-T3R2xhExK+uPjhgoiNoI6mQtmCSuRALMYjX2GrFAZAY=";
ita_old = "sha256-Rqe6BVbAbZmArLvTSWBNcwk3a2akLOCzvxvIJYMhyN0=";
jav = "sha256-FdR83e0UDnMdHBzsJIUIFNkEjcKbV1mVMMQDWaNfe6M=";
jpn = "sha256-b0FrkC0SnYzCjpnDMkQDSxz1JUnoVg9jILBtMXhSFZo=";
jpn_vert = "sha256-NoecGqB2NDAsncssHtT4+zR8cFrXUi3Wk+4unWgCink=";
kan = "sha256-TRLkRNe4lc2AVrD/O1biqU4+a7Oh0bwgXLM7mc/olVE=";
kat = "sha256-Kl4c1ZW3ERSUmjdRx/wicDkAXXcInhMI32sdxd8iJqw=";
kat_old = "sha256-UQXCYrpz3cniTUOXc70G7rX8XptxMgD5uA2OBPVx7tU=";
kaz = "sha256-cYeSnrIP+8cjbVlZ12GhjWKfx+t7HXp/uZrTsibwZ0A=";
khm = "sha256-yzU4Ejok/gjjYRsaZZgDCqgZk+qISzlFixqFbL0L/VQ=";
kir = "sha256-Q6MzrZYZXfm/7Qjdr7MI8w8UY9SY4gNilH0ahy/mfSY=";
kmr = "sha256-5llHfGE87Pk14mkvc+a4cqb8TQXx/uVSCDhF+BkDcuk=";
kor = "sha256-lSC/6ePPw41KgI4DawKHyIodN/uAuaCiOSjdzN0gWVs=";
kor_vert = "sha256-CC7y5mG3c8wilEZAuY2grHamhbDbucYPdmnOWO1vu/I=";
lao = "sha256-ha5mxb8EqMRbV8T49I/X2eBDvVCCjfdjYkQNvtCjfb8=";
lat = "sha256-eQ/IVLwoZVqnCnduPgFFSL1C6IEYR7hKYcnlPvCw6iw=";
lav = "sha256-goEdo/Hf7TbtvVsz4naueyXl5mvZSd9bq+p5doivGjs=";
lit = "sha256-e5q1JBf7CJ286H/UFPrdnWgILfUnUoUbnMWtwfhcT3I=";
ltz = "sha256-zEF9dLOAXmw77EFJWH4JWzvc6MNKRf3dQdThGO3q7Qs=";
mal = "sha256-LbtjlyAwyMZVXleRLZn4E6r+e/WbT9m5F5KaiL6LgSg=";
mar = "sha256-hFDLsZaxriMQwHoRRN+DGCdLZOG0Oqs6rXuylSCFXAM=";
mkd = "sha256-T6rQudft4N7GrDaG6RXLEAewFxeRlU+0I/+6TzuPDq8=";
mlt = "sha256-339C19/kfmP+maUlA2INzj5t4WYlO3bwyRAhroR6teY=";
mon = "sha256-kFqPMTZu/vNkg2+/tELLm+aCeQXkwdpk1fQmuxXbeso=";
mri = "sha256-sUAeaw9iNhstgpkpAh0jsMUv9vDNCjStpqxoIDpXjko=";
msa = "sha256-VhF0PATZ0xvidV5QqshtgVyviYZr9+HKJ3QoZRXS/1Q=";
mya = "sha256-YVUU69R2bHV+VYfunMDJ2bLnJ9yVcJjLJJk2pWCpkkI=";
nep = "sha256-wxRu8CWZYdWmUzm9uR3MtRmRrO48iuRW5M91A0UFHrY=";
nld = "sha256-sfZ2f1Da9ZA4AvuXDnufZO4fEr4LKzJN/fjosFdxVy8=";
nor = "sha256-uFnk3iTS0jkA2ZPXSBnTMzklVBQFe1CY2tKBmhiUqiI=";
oci = "sha256-u/UgOdCUpgbEn44h15/PsmD5/iv07D9kDy3Lpl/i+dc=";
ori = "sha256-6GhQO+YzSoyqCS45FNDO/PwqXeTjSkoNNRuG9WUVBOo=";
osd = "sha256-4Z8q6GB5L983LPSNjOcK5do8QFKWL+IuneH2gMN0uw4=";
pan = "sha256-UIwPtYrp41yqVx3oW8zlnqW373UaXaJ/96WbS1KexQQ=";
pol = "sha256-F56Rr7MjKUkoik4YbeROsL7/tqKVKDvr9K81o2s4Czw=";
por = "sha256-AWxqNxux5MSP5SGQjPO6PXUfreCrhGrV1AhrVj9cUow=";
pus = "sha256-uQ/O5S4DoeeMvN0yz7SLx94izFb6xa1CoAodYqelL0Y=";
que = "sha256-ZaWf96rz505Z3GX/fNyBZQMab8+V0lv21Fy2mKKrcwc=";
ron = "sha256-FTyCyAcYUpiDqeeREJCAJL72KFXZ1aC38lkPy4De5ik=";
rus = "sha256-aBviwr6tG8e9I134jETo5grnOuhmhAwK1OO0wke9N8I=";
san = "sha256-XR/UK1JNC5krfDuYyknbFu+mxPE30r2CY5gXVvLEl+I=";
sin = "sha256-xCQWB6/iV7nP2vpaFxKHt9BEH/VB47IUwPoDVYkW7SQ=";
slk = "sha256-M0U5fhZJqntniIoZKPBNGIeeB0a9AKOq/w06F8u9JzE=";
slk_frak = "sha256-cT7dJUQ5cueNftGCoAPfGcGz+N8tvmv4pR+FF6rSO5o=";
slv = "sha256-TvPT/0JarymFq5MlYjpZ34y9KtQqP8g+eQ3cUiqVhBg=";
snd = "sha256-ZyoVGmnKGp79/Ygbt6tHmUnhU0nHS/tt2oOSQEh0VcQ=";
spa = "sha256-Cw/LtGZRieAauAGeWR8BTdcmBGDeByVD7dSyy07efJY=";
spa_old = "sha256-Q2XJ2WyFEkVVinKuuF4NIEQGsFKrjgWd5TWPWAkDCMs=";
sqi = "sha256-ARyC6wqo2VQ7CdeRS1W5Kxs08s1PxMTINSClD3vcm6U=";
srp = "sha256-FPCNtRrj6luycyu0jAmVWQDYqsFGrv+G0n0bOIItosk=";
srp_latn = "sha256-P8I6VlHDejPY4t0GDEHh+/JiNQkUtaRqqQv8Yes55cw=";
sun = "sha256-6oaA9XYmP6G0TACWl6ZuMoVaEZ7JmAR2WSdvJwdXdFM=";
swa = "sha256-4EMKiLBjLTub/5b7qkUjOfxC0HyA/AAz/r8FdQvDyWM=";
swe = "sha256-JOLdFcwAiNIRxfG9SZceYAMX8gFQLerbxBfw/9bJpvg=";
syr = "sha256-aHg+E1WKiTXpzJ2+GeJUutUUwfe8Z5/hk+CEHbUr0u0=";
tam = "sha256-rrrgRz04udD5znUYO0M0gwvKuu+A3Q3Au1AocO1qEGY=";
tat = "sha256-5lyctRvEfR7td2FWPjLTCDL+OqrCsy72jp5cf9HN5Cg=";
tel = "sha256-fQkoEoidyLsfQtk7jZj2mFJ4AJ4xztMP9DTuDjtEmD0=";
tgk = "sha256-xzgovz+eBvpBwH95mCmwHU7ODj3SmUyRTWQ+M8F8qJA=";
tgl = "sha256-dnJiuUmQHqczAjmZ8bLUUfD+ggBBZr1rEHT4Nhln2os=";
tha = "sha256-iAMqnyGsz/gl767SlgTrilNOJlz4BYqV6lQXpt+RwAU=";
tir = "sha256-06XlsFwn4iCV6xxxJwasvkn5bQQC3xFOKRsyGRYi3OA=";
ton = "sha256-uK3o84oF7AaFs+3rRb4NGgMCtyZtZ1yjkkj7jNQD5hk=";
tur = "sha256-SJuVBOgNcYTtGsmhl2ZHiE7nEUnaIx/zwsHcFTcPLz0=";
uig = "sha256-iBTbyJjNR7k3nLBpEGSsAit5QcjYN2HgHWpwGkSXSic=";
ukr = "sha256-ZAyfvaGsRdHIh0HvAcaIwzdVnDf1Y8NuYufl+ZCmCJM=";
urd = "sha256-gLwoL7uumavWtAcITEAakw3cSTQ3GRCeZQ13lTH8epc=";
uzb = "sha256-9jx8jWFvVOiIMJ8E6vVWgof0CsqlTU40zlHWrTbgHg4=";
uzb_cyrl = "sha256-B6vbCeDHm5FE3SL94BBlUqwyFhBMEwVmWM9RcXOmY5A=";
vie = "sha256-Fk2b7X5aZERYbTlDTMGt9N+XbP4jz/1kaOREyUcDZAo=";
yid = "sha256-H1AC4G/G7jOuvJJZb9u8ofDF5RqKi/PwVTjsTkDcy3Y=";
yor = "sha256-m35CeoAKh2Rg8CDVaDgCkuIm1i/4pOutieZZUSJTgx8=";
};
};
}

View File

@@ -0,0 +1,60 @@
{
lib,
stdenv,
fetchFromGitHub,
autoreconfHook,
pkg-config,
leptonica,
libpng,
libtiff,
icu,
pango,
opencl-headers,
}:
stdenv.mkDerivation rec {
pname = "tesseract";
version = "3.05.02";
src = fetchFromGitHub {
owner = "tesseract-ocr";
repo = "tesseract";
rev = version;
hash = "sha256-28osuZnVwkJpNTYkU+5D5PI8xtViFzGCMScHzkS2H20=";
};
# leptonica 1.83 made internal structures private. using internal headers isn't
# great, but tesseract3's days are numbered anyway
postPatch = ''
for f in textord/devanagari_processing.cpp cube/cube_line_object.h cube/cube_line_segmenter.h cube/cube_utils.h ; do
sed -i '/allheaders.h/a#include "pix_internal.h"' "$f"
done
'';
enableParallelBuilding = true;
nativeBuildInputs = [
pkg-config
autoreconfHook
];
buildInputs = [
leptonica
libpng
libtiff
icu
pango
opencl-headers
];
LIBLEPT_HEADERSDIR = "${leptonica}/include";
meta = {
description = "OCR engine";
homepage = "https://github.com/tesseract-ocr/tesseract";
license = lib.licenses.asl20;
maintainers = with lib.maintainers; [ erikarvstedt ];
platforms = with lib.platforms; linux ++ darwin;
mainProgram = "tesseract";
};
}

View File

@@ -0,0 +1,66 @@
{
lib,
stdenv,
fetchFromGitHub,
autoreconfHook,
autoconf-archive,
pkg-config,
leptonica,
libpng,
libtiff,
icu,
pango,
opencl-headers,
}:
stdenv.mkDerivation rec {
pname = "tesseract";
version = "4.1.3";
src = fetchFromGitHub {
owner = "tesseract-ocr";
repo = "tesseract";
rev = version;
hash = "sha256-sV3w53ky13ESc0dGPutMGQ4TcmOeWJkvUwBPIyzSTc8=";
};
# leptonica 1.83 made internal structures private. using internal headers isn't
# great, but tesseract4's days are numbered anyway
postPatch = ''
sed -i '/allheaders.h/a#include "pix_internal.h"' src/textord/devanagari_processing.cpp
# gcc-13 compat fix, simulate this upstream patch:
# https://github.com/tesseract-ocr/tesseract/commit/17e795aaae7d40dbcb7d3365835c2f55ecc6355d.patch
# https://github.com/tesseract-ocr/tesseract/commit/c0db7b7e930322826e09981360e39fdbd16cc9b0.patch
sed -i src/ccutil/helpers.h -e '1i #include <climits>'
sed -i src/ccutil/helpers.h -e '1i #include <cstdint>'
sed -i src/dict/matchdefs.h -e '1i #include <cstdint>'
'';
enableParallelBuilding = true;
nativeBuildInputs = [
pkg-config
autoreconfHook
autoconf-archive
];
buildInputs = [
leptonica
libpng
libtiff
icu
pango
opencl-headers
];
meta = {
description = "OCR engine";
homepage = "https://github.com/tesseract-ocr/tesseract";
license = lib.licenses.asl20;
maintainers = with lib.maintainers; [ erikarvstedt ];
platforms = with lib.platforms; linux ++ darwin;
mainProgram = "tesseract";
};
}

View File

@@ -0,0 +1,54 @@
{
lib,
stdenv,
fetchFromGitHub,
nix-update-script,
autoreconfHook,
pkg-config,
curl,
leptonica,
libarchive,
libpng,
libtiff,
icu,
pango,
}:
stdenv.mkDerivation rec {
pname = "tesseract";
version = "5.5.1";
src = fetchFromGitHub {
owner = "tesseract-ocr";
repo = "tesseract";
rev = version;
sha256 = "sha256-bLTYdT9CNfgrmmjP6m0rRqJDHiSOkcuGVCFwPqT12jk=";
};
enableParallelBuilding = true;
nativeBuildInputs = [
pkg-config
autoreconfHook
];
buildInputs = [
curl
leptonica
libarchive
libpng
libtiff
icu
pango
];
passthru.updateScript = nix-update-script { };
meta = {
description = "OCR engine";
homepage = "https://github.com/tesseract-ocr/tesseract";
license = lib.licenses.asl20;
maintainers = with lib.maintainers; [ patrickdag ];
platforms = lib.platforms.unix;
mainProgram = "tesseract";
};
}

View File

@@ -0,0 +1,101 @@
{
lib,
makeWrapper,
tesseractBase,
languages,
runCommand,
imagemagick,
# A list of languages like [ "eng" "spa" … ] or `null` for all available languages
enableLanguages ? null,
# A list of files or a directory containing files
tessdata ? (
if enableLanguages == null then languages.all else map (lang: languages.${lang}) enableLanguages
),
# This argument is obsolete
enableLanguagesHash ? null,
}:
let
tesseractWithData = tesseractBase.overrideAttrs (_: {
inherit tesseractBase tessdata;
nativeBuildInputs = [ makeWrapper ];
buildPhase = ''
makeWrapper {$tesseractBase,$out}/bin/tesseract --set-default TESSDATA_PREFIX $out/share/tessdata
# Recursively link include, share
cp -rs --no-preserve=mode $tesseractBase/{include,share} $out
cp -r --no-preserve=mode $tesseractBase/lib $out
# Fixup the store paths in lib so that the tessdata from this derivation is used.
if (( ''${#tesseractBase} != ''${#out} )); then
echo "Can't replace store paths due to differing lengths"
exit 1
fi
find $out/lib -type f -exec sed -i "s|$tesseractBase|$out|g" {} \;
if [[ -d "$tessdata" ]]; then
ln -s $tessdata/* $out/share/tessdata
else
for lang in $tessdata; do
ln -s $lang $out/share/tessdata/''${lang#/nix/store*-}
done
fi
if [[ ! -e $out/share/tessdata/eng.traineddata ]]; then
# This is a bug in Tesseract's internal tessdata discovery mechanism
echo "eng.traineddata must be present in tessdata for Tesseract to work"
exit 1
fi
'';
});
passthru = { inherit tesseractBase languages tessdata; };
# Only run test when all languages are available
test =
runCommand "tesseract-test-ocr"
{
buildInputs = [
tesseractWithData
imagemagick
];
}
''
text="hello nix"
convert -size 400x40 xc:white -font 'DejaVu-Sans' -pointsize 20 \
-fill black -annotate +5+20 "$text" /tmp/test-img.png 2>/dev/null
ocrResult=$(tesseract /tmp/test-img.png - | tr -d "\f")
if [[ $ocrResult != $text ]]; then
echo "OCR test failed"
echo "expected: '$text'"
echo "actual: '$ocrResult'"
exit 1
fi
touch $out
'';
tesseract =
(if enableLanguages == [ ] then tesseractBase else tesseractWithData).overrideAttrs
(old: {
passthru =
(old.passthru or { })
// passthru
// lib.optionalAttrs (enableLanguages == null) {
tests = (old.passthru.tests or { }) // {
default = test;
};
};
});
in
if enableLanguagesHash == null then
tesseract
else
lib.warn "Argument `enableLanguagesHash` is obsolete and can be removed." tesseract

View File

@@ -0,0 +1,103 @@
{
lib,
stdenv,
fetchurl,
makeWrapper,
autoPatchelfHook,
libX11,
libXext,
libXrandr,
libXinerama,
libglvnd,
openal,
glibc,
makeDesktopItem,
copyDesktopItems,
imagemagick,
liberation_ttf,
}:
stdenv.mkDerivation rec {
pname = "unigine-sanctuary";
version = "2.3";
src = fetchurl {
url = "https://assets.unigine.com/d/Unigine_Sanctuary-${version}.run";
sha256 = "sha256-KKi70ctkEm+tx0kjBMWVKMLDrJ1TsPH+CKLDMXA6OdU=";
};
libPath = lib.makeLibraryPath [
libglvnd
openal
glibc
];
installPhase = ''
bash $src --target ${pname}-${version}
install -D -m 0755 ${pname}-${version}/bin/libUnigine_x86.so $out/lib/unigine/sanctuary/bin/libUnigine_x86.so
install -D -m 0755 ${pname}-${version}/bin/Sanctuary $out/lib/unigine/sanctuary/bin/Sanctuary
install -D -m 0755 ${pname}-${version}/1024x768_windowed.sh $out/bin/Sanctuary
cp -R ${pname}-${version}/data $out/lib/unigine/sanctuary
wrapProgram $out/bin/Sanctuary \
--prefix LD_LIBRARY_PATH : ${libPath}:$out/lib/unigine/sanctuary/bin \
--run "cd $out/lib/unigine/sanctuary"
convert -size 256x256 xc:Transparent -define gradient:center="128,128" -define gradient:vector="128,128 128,128" \
-define gradient:radii="128,128" -fill radial-gradient:'rgb(164,0,0)-rgb(67,1,3)' \
-draw "roundRectangle 0,0 256,256 50,50" ${pname}-${version}/icon.png
convert ${pname}-${version}/icon.png -size 181.991x181.991 -font ${liberation_ttf}/share/fonts/truetype/LiberationSans-Regular.ttf \
-pointsize 181.991 -define gradient:center="128,128" -define gradient:vector="128,128 128,128" \
-define gradient:radii="46.6974,46.6974" -fill radial-gradient:'rgb(249,197,46)-rgb(218,144,31)' \
-stroke none -strokewidth 4.54977 -draw 'text 69.3061,194.247 "S"' ${pname}-${version}/icon.png
for RES in 16 24 32 48 64 128 256; do
mkdir -p $out/share/icons/hicolor/"$RES"x"$RES"/apps
convert ${pname}-${version}/icon.png -resize "$RES"x"$RES" $out/share/icons/hicolor/"$RES"x"$RES"/apps/Sanctuary.png
done
convert ${pname}-${version}/icon.png -resize 128x128 $out/share/icons/Sanctuary.png
runHook postInstall
'';
desktopItems = [
(makeDesktopItem {
name = "Sanctuary";
exec = "Sanctuary";
genericName = "A GPU Stress test tool from the UNIGINE";
icon = "Sanctuary";
desktopName = "Sanctuary Benchmark";
})
];
nativeBuildInputs = [
autoPatchelfHook
makeWrapper
imagemagick
copyDesktopItems
];
buildInputs = [
stdenv.cc.cc
libX11
libXext
libXrandr
libXinerama
];
dontUnpack = true;
meta = {
description = "Unigine Heaven GPU benchmarking tool";
homepage = "https://benchmark.unigine.com/sanctuary";
sourceProvenance = with lib.sourceTypes; [ binaryNativeCode ];
license = lib.licenses.unfree;
maintainers = [ lib.maintainers.BarinovMaxim ];
platforms = [
"x86_64-linux"
"i686-linux"
];
mainProgram = "Sanctuary";
};
}

View File

@@ -0,0 +1,150 @@
{
lib,
glib,
stdenv,
dbus,
freetype,
fontconfig,
zlib,
qtquickcontrols2,
libXinerama,
libxcb,
libSM,
libXi,
libglvnd,
libXext,
libXrandr,
mailspring,
libX11,
libICE,
libXrender,
autoPatchelfHook,
makeWrapper,
mkDerivation,
xkeyboard_config,
fetchurl,
buildFHSEnv,
openal,
makeDesktopItem,
}:
let
pname = "unigine-superposition";
version = "1.1";
superposition = stdenv.mkDerivation rec {
inherit pname version;
src = fetchurl {
url = "https://assets.unigine.com/d/Unigine_Superposition-${version}.run";
sha256 = "12hzlz792pf8pvxf13fww3qhahqzwzkxq9q3mq20hbhvaphbg7nd";
};
nativeBuildInputs = [
autoPatchelfHook
makeWrapper
];
buildInputs = [
glib
stdenv.cc.cc
dbus
freetype
fontconfig
zlib
qtquickcontrols2
libXinerama
libxcb
libSM
libXi
libglvnd
libXext
libXrandr
mailspring
libX11
libICE
libXrender
];
installPhase = ''
bash $src --target $name --noexec
mkdir -p $out/bin $out/lib/unigine/superposition/
cp -r $name/* $out/lib/unigine/superposition/
echo "exec $out/lib/unigine/superposition/Superposition" >> $out/bin/superposition
chmod +x $out/bin/superposition
wrapProgram $out/lib/unigine/superposition/Superposition \
--set QT_XKB_CONFIG_ROOT ${xkeyboard_config} \
--run "cd $out/lib/unigine/superposition/"
'';
dontUnpack = true;
dontWrapQtApps = true;
postPatchMkspecs = ''
cp -f $name/bin/superposition $out/lib/unigine/superposition/bin/superposition
'';
};
desktopItem = makeDesktopItem {
name = "Superposition";
exec = "unigine-superposition";
genericName = "A GPU Stress test tool from the UNIGINE";
icon = "Superposition";
desktopName = "Superposition Benchmark";
};
in
# We can patch the "/bin/superposition", but "/bin/launcher" checks it for changes.
# For that we need use a buildFHSEnv.
buildFHSEnv {
inherit pname version;
targetPkgs = pkgs: [
superposition
glib
stdenv.cc.cc
dbus
freetype
fontconfig
zlib
qtquickcontrols2
libXinerama
libxcb
libSM
libXi
libglvnd
libXext
libXrandr
mailspring
libX11
libICE
libXrender
openal
];
runScript = "superposition";
extraInstallCommands = ''
# create directories
mkdir -p $out/share/icons/hicolor $out/share/applications
# create .desktop file
ln -s ${desktopItem}/share/applications/* $out/share/applications
# install Superposition.desktop and icon
cp ${superposition}/lib/unigine/superposition/Superposition.png $out/share/icons/
for RES in 16 24 32 48 64 128 256; do
mkdir -p $out/share/icons/hicolor/"$RES"x"$RES"/apps
cp ${superposition}/lib/unigine/superposition/icons/superposition_icon_$RES.png $out/share/icons/hicolor/"$RES"x"$RES"/apps/Superposition.png
done
'';
meta = {
description = "Unigine Superposition GPU benchmarking tool";
homepage = "https://benchmark.unigine.com/superposition";
sourceProvenance = with lib.sourceTypes; [ binaryNativeCode ];
license = lib.licenses.unfree;
maintainers = [ lib.maintainers.BarinovMaxim ];
platforms = [ "x86_64-linux" ];
mainProgram = "unigine-superposition";
};
}

View File

@@ -0,0 +1,101 @@
{
lib,
stdenv,
fetchurl,
makeWrapper,
autoPatchelfHook,
libX11,
libXext,
libXrandr,
libXinerama,
libglvnd,
openal,
glibc,
makeDesktopItem,
copyDesktopItems,
imagemagick,
}:
let
version = "1.3";
in
stdenv.mkDerivation {
pname = "unigine-tropics";
inherit version;
src = fetchurl {
url = "https://assets.unigine.com/d/Unigine_Tropics-${version}.run";
sha256 = "sha256-/eA1i42/PMcoBbUJIGS66j7QpZ13oPkOi1Y6Q27TikU=";
};
libPath = lib.makeLibraryPath [
libglvnd
openal
glibc
];
installPhase = ''
bash $src --target $name
install -D -m 0755 $name/bin/libUnigine_x86.so $out/lib/unigine/tropics/bin/libUnigine_x86.so
install -D -m 0755 $name/bin/Tropics $out/lib/unigine/tropics/bin/Tropics
install -D -m 0755 $name/1024x768_windowed.sh $out/bin/Tropics
cp -R $name/data $out/lib/unigine/tropics
wrapProgram $out/bin/Tropics \
--prefix LD_LIBRARY_PATH : $libPath:$out/lib/unigine/tropics/bin \
--run "cd $out/lib/unigine/tropics"
convert -size 256x256 xc:Transparent -fill gradient:'dodgerblue-white' -stroke Transparent -draw "roundrectangle 0,0 256,256 50,50" $name/icon.png
convert $name/icon.png -fill white -stroke white -draw "polygon 69.2564,84.1261 117.9,84.1261 117.9,206.56 138.1,206.56 138.1,84.1261 186.744,84.1261 186.744,65.9877 69.2564,65.9877 69.2564,84.1261" $name/icon.png
for RES in 16 24 32 48 64 128 256
do
mkdir -p $out/share/icons/hicolor/"$RES"x"$RES"/apps
convert $name/icon.png -resize "$RES"x"$RES" $out/share/icons/hicolor/"$RES"x"$RES"/apps/Tropics.png
done
convert $name/icon.png -resize 128x128 $out/share/icons/Tropics.png
runHook postInstall
'';
desktopItems = [
(makeDesktopItem {
name = "Tropics";
exec = "Tropics";
genericName = "A GPU Stress test tool from the UNIGINE";
icon = "Tropics";
desktopName = "Tropics Benchmark";
})
];
nativeBuildInputs = [
autoPatchelfHook
makeWrapper
imagemagick
copyDesktopItems
];
buildInputs = [
stdenv.cc.cc
libX11
libXext
libXrandr
libXinerama
];
dontUnpack = true;
meta = {
description = "Unigine Heaven GPU benchmarking tool";
homepage = "https://benchmark.unigine.com/tropics";
sourceProvenance = with lib.sourceTypes; [ binaryNativeCode ];
license = lib.licenses.unfree;
maintainers = [ lib.maintainers.BarinovMaxim ];
platforms = [
"x86_64-linux"
"i686-linux"
];
mainProgram = "Tropics";
};
}

View File

@@ -0,0 +1,91 @@
{
lib,
stdenv,
fetchFromGitHub,
cmake,
gettext,
wrapGAppsHook3,
pkg-config,
adwaita-icon-theme,
alsa-lib,
binutils,
glib,
gsettings-desktop-schemas,
gtk3,
gtksourceview4,
librsvg,
libsndfile,
libxml2,
libzip,
pcre,
poppler,
portaudio,
zlib,
# plugins
withLua ? true,
lua,
}:
stdenv.mkDerivation rec {
pname = "xournalpp";
version = "1.2.8";
src = fetchFromGitHub {
owner = "xournalpp";
repo = "xournalpp";
rev = "v${version}";
hash = "sha256-yQN90R2gxUunUimZqT2kncnCNtDaLD36ctf1bU2vmIw=";
};
postPatch = ''
substituteInPlace src/util/Stacktrace.cpp \
--replace-fail "addr2line" "${binutils}/bin/addr2line"
'';
nativeBuildInputs = [
cmake
gettext
pkg-config
wrapGAppsHook3
];
buildInputs =
lib.optionals stdenv.hostPlatform.isLinux [
alsa-lib
]
++ [
glib
gsettings-desktop-schemas
gtk3
gtksourceview4
librsvg
libsndfile
libxml2
libzip
pcre
poppler
portaudio
zlib
]
++ lib.optional withLua lua;
buildFlags = [ "translations" ];
preFixup = ''
gappsWrapperArgs+=(
--prefix XDG_DATA_DIRS : "${adwaita-icon-theme}/share"
)
'';
meta = {
description = "Xournal++ is a handwriting Notetaking software with PDF annotation support";
homepage = "https://xournalpp.github.io/";
changelog = "https://github.com/xournalpp/xournalpp/blob/v${version}/CHANGELOG.md";
license = lib.licenses.gpl2Plus;
maintainers = with lib.maintainers; [ sikmir ];
platforms = lib.platforms.unix;
mainProgram = "xournalpp";
};
}

View File

@@ -0,0 +1,11 @@
diff --git a/src/modesel.c b/src/modesel.c
--- src/modesel.c
+++ src/modesel.c
@@ -6,6 +6,7 @@
*/
#include <stdio.h>
+#include <stdlib.h>
#include "zgv_io.h"
#include "readnbkey.h"
#include "modesel.h"

View File

@@ -0,0 +1,61 @@
{
lib,
stdenv,
fetchurl,
fetchpatch,
pkg-config,
SDL,
SDL_image,
libjpeg,
libpng,
libtiff,
}:
stdenv.mkDerivation rec {
pname = "zgv";
version = "5.9";
src = fetchurl {
url = "https://www.svgalib.org/rus/zgv/${pname}-${version}.tar.gz";
sha256 = "1fk4i9x0cpnpn3llam0zy2pkmhlr2hy3iaxhxg07v9sizd4dircj";
};
nativeBuildInputs = [ pkg-config ];
buildInputs = [
SDL
SDL_image
libjpeg
libpng
libtiff
];
hardeningDisable = [ "format" ];
makeFlags = [
"BACKEND=SDL"
];
patches = [
./add-include.patch
(fetchpatch {
url = "https://foss.aueb.gr/mirrors/linux/gentoo/media-gfx/zgv/files/zgv-5.9-libpng15.patch";
sha256 = "1blw9n04c28bnwcmcn64si4f5zpg42s8yn345js88fyzi9zm19xw";
})
./switch.patch
];
patchFlags = [ "-p0" ];
installPhase = ''
mkdir -p $out/bin
cp src/zgv $out/bin
'';
meta = with lib; {
homepage = "http://www.svgalib.org/rus/zgv/";
description = "Picture viewer with a thumbnail-based selector";
license = licenses.gpl2;
maintainers = [ ];
platforms = platforms.linux;
mainProgram = "zgv";
};
}

View File

@@ -0,0 +1,14 @@
GCC complains
diff -ur src/zgv_io.c src/zgv_io.c
--- src/zgv_io.c 2005-01-20 15:07:46.000000000 -0800
+++ src/zgv_io.c 2016-06-29 10:19:40.169897611 -0700
@@ -645,7 +645,7 @@
case SDLK_INSERT: return(RK_INSERT);
case SDLK_DELETE: return(RK_DELETE);
case SDLK_RETURN: return(RK_ENTER);
- default:
+ default: ;
/* stop complaints */
}