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,209 @@
{
lib,
stdenv,
fetchurl,
autoreconfHook,
bison,
glm,
flex,
wrapQtAppsHook,
cmake,
pkg-config,
libglut,
ghostscriptX,
imagemagick,
fftw,
eigen,
libtirpc,
boehmgc,
libGLU,
libGL,
libglvnd,
ncurses,
readline,
gsl,
libsigsegv,
python3,
qtbase,
qtsvg,
boost186,
zlib,
perl,
curl,
texinfo,
texliveSmall,
}:
stdenv.mkDerivation (finalAttrs: {
version = "3.05";
pname = "asymptote";
outputs = [
"out"
"man"
"info"
"doc"
"tex"
];
src = fetchurl {
url = "mirror://sourceforge/asymptote/${finalAttrs.version}/asymptote-${finalAttrs.version}.src.tgz";
hash = "sha256-NcFtCjvdhppW5O//Rjj4HDqIsva2ZNGWRxAV2/TGmoc=";
};
# override with TeX Live containers to avoid building sty, docs from source
texContainer = null;
texdocContainer = null;
nativeBuildInputs = [
autoreconfHook
bison
flex
bison
texinfo
wrapQtAppsHook
cmake
ghostscriptX
perl
pkg-config
(python3.withPackages (
ps: with ps; [
click
cson
numpy
pyqt5
]
))
]
++ lib.optional (finalAttrs.texContainer == null || finalAttrs.texdocContainer == null) (
texliveSmall.withPackages (
ps: with ps; [
epsf
cm-super
ps.texinfo
media9
ocgx2
collection-latexextra
]
)
);
buildInputs = [
ghostscriptX
imagemagick
fftw
eigen
boehmgc
ncurses
readline
gsl
libsigsegv
zlib
perl
curl
qtbase
qtsvg
# relies on removed asio::io_service
# https://github.com/kuafuwang/LspCpp/issues/52
boost186
(python3.withPackages (
ps: with ps; [
cson
numpy
pyqt5
]
))
]
++ lib.optionals stdenv.hostPlatform.isLinux [ libtirpc ];
propagatedBuildInputs = [
glm
]
++ lib.optionals stdenv.hostPlatform.isLinux [
libglut
libGLU
libGL
libglvnd
];
dontWrapQtApps = true;
# do not build $tex/ls-R which will be generated by texlive.withPackages
# do not build and install sty and docs, if provided by tex/texdoc texlive containers
# (this is an optimisation to make texliveMedium and texliveFull independent of texliveSmall)
preConfigure = ''
HOME=$TMP
substituteInPlace Makefile.in \
--replace-fail ' install-texhash' '''
if [[ -n $texContainer ]] ; then
sed -i Makefile.in -e '/(\(latex\|context\)dir)/d'
substituteInPlace Makefile.in \
--replace-fail 'asy sty' 'asy'
else
prependToVar configureFlags "--with-latex=$tex/tex/latex" "--with-context=$tex/tex/context/third"
fi
if [[ -n $texdocContainer ]] ; then
substituteInPlace Makefile.in \
--replace-fail ' install-man' ''' \
--replace-fail 'docdir = $(DESTDIR)@docdir@' 'docdir = $(TMP)/doc'
fi
'';
# do not use bundled libgc.so
configureFlags = [ "--enable-gc=system" ];
env.NIX_CFLAGS_COMPILE = "-I${boehmgc.dev}/include/gc";
postInstall = ''
rm "$out"/bin/xasy
chmod +x "$out"/share/asymptote/GUI/xasy.py
makeQtWrapper "$out"/share/asymptote/GUI/xasy.py "$out"/bin/xasy --prefix PATH : "$out"/bin
if [[ -z $texdocContainer ]] ; then
mv "$info"/share/info/asymptote/*.info "$info"/share/info/
sed -i -e 's|(asymptote/asymptote)|(asymptote)|' "$info"/share/info/asymptote.info
rmdir "$info"/share/info/asymptote
rm -f "$info"/share/info/dir
fi
install -Dt $out/share/emacs/site-lisp/${finalAttrs.pname} $out/share/asymptote/*.el
'';
# fixupPhase crashes if the outputs are not directories
preFixup = ''
if [[ -n $texContainer ]] ; then
mkdir -p "$tex"
fi
if [[ -n $texdocContainer ]] ; then
mkdir -p "$doc" "$man" "$info"
fi
'';
postFixup = ''
if [[ -n $texContainer ]] ; then
rmdir "$tex"
ln -s "$texContainer" "$tex"
fi
if [[ -n $texdocContainer ]] ; then
mkdir -p "$man/share" "$info/share"
ln -s "$texdocContainer" "$doc/share"
ln -s "$texdocContainer/doc/man" "$man/share"
ln -s "$texdocContainer/doc/info" "$info/share"
fi
'';
dontUseCmakeConfigure = true;
enableParallelBuilding = true;
# Missing install depends:
# ...-coreutils-9.1/bin/install: cannot stat 'asy-keywords.el': No such file or directory
# make: *** [Makefile:272: install-asy] Error 1
enableParallelInstalling = false;
meta = with lib; {
description = "Tool for programming graphics intended to replace Metapost";
homepage = "https://asymptote.sourceforge.io/";
license = licenses.gpl3Plus;
maintainers = [ maintainers.raskin ];
platforms = platforms.linux ++ platforms.darwin;
};
})

View File

@@ -0,0 +1,63 @@
/*
If a user needs access to more haskell packages for building their
diagrams, they simply have to pass these packages through the
extraPackages function, as follows:
~~~
diagrams-builder.override {
extraPackages = self: [ self.myHaskellPackage ];
}
­~~~
*/
{
lib,
stdenv,
ghcWithPackages,
makeWrapper,
diagrams-builder,
extraPackages ? (self: [ ]),
}:
let
# Used same technique as for the yiCustom package.
wrappedGhc = ghcWithPackages (self: [ diagrams-builder ] ++ extraPackages self);
ghc = lib.getExe' wrappedGhc "ghc";
exeWrapper =
backend:
let
exe = "${diagrams-builder}/bin/diagrams-builder-${backend}";
in
''
test ! -x "${exe}" || \
makeWrapper "${exe}" \
"$out/bin/diagrams-builder-${backend}" \
--set NIX_GHC ${ghc} \
--set NIX_GHC_LIBDIR "$(${ghc} --print-libdir)"
'';
# Needs to match executable, suffix, not flag name
allBackends = [
"svg"
"ps"
"cairo"
"rasterific"
"pgf"
];
in
stdenv.mkDerivation {
pname = "diagrams-builder";
inherit (diagrams-builder) version;
nativeBuildInputs = [ makeWrapper ];
buildCommand = lib.concatStringsSep "\n" (map exeWrapper allBackends);
# Will be faster to build the wrapper locally then to fetch it from a binary cache.
preferLocalBuild = true;
meta = diagrams-builder.meta;
}

View File

@@ -0,0 +1,138 @@
{
lib,
stdenv,
fetchurl,
makeWrapper,
pkg-config,
texinfo,
cairo,
gd,
libcerf,
pango,
readline,
zlib,
withTeXLive ? false,
texliveSmall,
withLua ? false,
lua,
withCaca ? false,
libcaca,
libX11 ? null,
libXt ? null,
libXpm ? null,
libXaw ? null,
aquaterm ? false,
withWxGTK ? false,
wxGTK32,
fontconfig ? null,
gnused ? null,
coreutils ? null,
withQt ? false,
mkDerivation,
qttools,
qtbase,
qtsvg,
}:
assert libX11 != null -> (fontconfig != null && gnused != null && coreutils != null);
let
withX = libX11 != null && !aquaterm && !stdenv.hostPlatform.isDarwin;
in
(if withQt then mkDerivation else stdenv.mkDerivation) rec {
pname = "gnuplot";
version = "6.0.3";
src = fetchurl {
url = "mirror://sourceforge/gnuplot/${pname}-${version}.tar.gz";
sha256 = "sha256-7FLjr4xAg9RTgVKz8T20f20pkpo/bs7FNlyDTnfyUas=";
};
nativeBuildInputs = [
makeWrapper
pkg-config
texinfo
]
++ lib.optional withQt qttools;
buildInputs = [
cairo
gd
libcerf
pango
readline
zlib
]
++ lib.optional withTeXLive texliveSmall
++ lib.optional withLua lua
++ lib.optional withCaca libcaca
++ lib.optionals withX [
libX11
libXpm
libXt
libXaw
]
++ lib.optionals withQt [
qtbase
qtsvg
]
++ lib.optional withWxGTK wxGTK32;
postPatch = ''
# lrelease is in qttools, not in qtbase.
sed -i configure -e 's|''${QT5LOC}/lrelease|lrelease|'
'';
configureFlags = [
(if withX then "--with-x" else "--without-x")
(if withQt then "--with-qt=qt5" else "--without-qt")
(if aquaterm then "--with-aquaterm" else "--without-aquaterm")
]
++ lib.optional withCaca "--with-caca"
++ lib.optional withTeXLive "--with-texdir=${placeholder "out"}/share/texmf/tex/latex/gnuplot";
CXXFLAGS = lib.optionalString (stdenv.hostPlatform.isDarwin && withQt) "-std=c++11";
# we'll wrap things ourselves
dontWrapGApps = true;
dontWrapQtApps = true;
# binary wrappers don't support --run
postInstall = lib.optionalString withX ''
wrapProgramShell $out/bin/gnuplot \
--prefix PATH : '${
lib.makeBinPath [
gnused
coreutils
fontconfig.bin
]
}' \
"''${gappsWrapperArgs[@]}" \
"''${qtWrapperArgs[@]}" \
--run '. ${./set-gdfontpath-from-fontconfig.sh}'
'';
# When cross-compiling, don't build docs and demos.
# Inspiration taken from https://sourceforge.net/p/gnuplot/gnuplot-main/merge-requests/10/
makeFlags = lib.optionals (!stdenv.buildPlatform.canExecute stdenv.hostPlatform) [
"-C src"
];
enableParallelBuilding = true;
meta = with lib; {
homepage = "http://www.gnuplot.info/";
description = "Portable command-line driven graphing utility for many platforms";
platforms = platforms.linux ++ platforms.darwin;
license = {
# Essentially a BSD license with one modification:
# Permission to modify the software is granted, but not the right to
# distribute the complete modified source code. Modifications are to
# be distributed as patches to the released version. Permission to
# distribute binaries produced by compiling modified sources is granted,
# provided you: ...
url = "https://sourceforge.net/p/gnuplot/gnuplot-main/ci/master/tree/Copyright";
};
maintainers = with maintainers; [ lovek323 ];
mainProgram = "gnuplot";
};
}

View File

@@ -0,0 +1,4 @@
p=( $(fc-list : file | sed "s@/[^/]*: @@" | sort -u) )
IFS=:
export GDFONTPATH="${GDFONTPATH}${GDFONTPATH:+:}${p[*]}"
unset IFS p

View File

@@ -0,0 +1,116 @@
{
lib,
stdenv,
fetchFromGitLab,
autoreconfHook,
pkg-config,
cairo,
expat,
flex,
fontconfig,
gd,
gts,
libjpeg,
libpng,
libtool,
makeWrapper,
pango,
bash,
bison,
xorg,
python3,
withXorg ? true,
# for passthru.tests
exiv2,
fltk,
graphicsmagick,
}:
let
inherit (lib) optional optionals optionalString;
in
stdenv.mkDerivation rec {
pname = "graphviz";
version = "12.2.1";
src = fetchFromGitLab {
owner = "graphviz";
repo = "graphviz";
rev = version;
hash = "sha256-Uxqg/7+LpSGX4lGH12uRBxukVw0IswFPfpb2EkLsaiI=";
};
nativeBuildInputs = [
autoreconfHook
makeWrapper
pkg-config
python3
bison
flex
];
buildInputs = [
libpng
libjpeg
expat
fontconfig
gd
gts
pango
bash
]
++ optionals withXorg (with xorg; [ libXrender ]);
hardeningDisable = [ "fortify" ];
configureFlags = [
"--with-ltdl-lib=${libtool.lib}/lib"
"--with-ltdl-include=${libtool}/include"
]
++ optional (xorg == null) "--without-x";
enableParallelBuilding = true;
CPPFLAGS = optionalString (withXorg && stdenv.hostPlatform.isDarwin) "-I${cairo.dev}/include/cairo";
doCheck = false; # fails with "Graphviz test suite requires ksh93" which is not in nixpkgs
preAutoreconf = ''
./autogen.sh
'';
postFixup = optionalString withXorg ''
substituteInPlace $out/bin/vimdot \
--replace-warn '"/usr/bin/vi"' '"$(command -v vi)"' \
--replace-warn '"/usr/bin/vim"' '"$(command -v vim)"' \
--replace-warn /usr/bin/vimdot $out/bin/vimdot
wrapProgram $out/bin/vimdot --prefix PATH : "$out/bin"
'';
passthru.tests = {
inherit (python3.pkgs)
graphviz
pydot
pygraphviz
xdot
;
inherit
exiv2
fltk
graphicsmagick
;
};
meta = with lib; {
homepage = "https://graphviz.org";
description = "Graph visualization tools";
license = licenses.epl10;
platforms = platforms.unix;
maintainers = with maintainers; [
bjornfor
raskin
];
};
}

View File

@@ -0,0 +1,256 @@
{
lib,
stdenv,
fetchFromGitHub,
fetchurl,
replaceVars,
coreutils,
curl,
gnugrep,
gnused,
xdg-utils,
dbus,
libGL,
libX11,
hwdata,
mangohud32,
addDriverRunpath,
appstream,
glslang,
python3Packages,
meson,
ninja,
pkg-config,
unzip,
wayland,
libXNVCtrl,
nlohmann_json,
spdlog,
libxkbcommon,
glew,
glfw,
libXrandr,
x11Support ? true,
waylandSupport ? true,
nvidiaSupport ? lib.meta.availableOn stdenv.hostPlatform libXNVCtrl,
gamescopeSupport ? true,
mangoappSupport ? gamescopeSupport,
mangohudctlSupport ? gamescopeSupport,
lowerBitnessSupport ? stdenv.hostPlatform.isx86_64, # Support 32 bit on 64bit
nix-update-script,
}:
assert lib.assertMsg (
x11Support || waylandSupport
) "either x11Support or waylandSupport should be enabled";
assert lib.assertMsg (nvidiaSupport -> x11Support) "nvidiaSupport requires x11Support";
assert lib.assertMsg (mangoappSupport -> x11Support) "mangoappSupport requires x11Support";
let
# Derived from subprojects/imgui.wrap
imgui = rec {
version = "1.89.9";
src = fetchFromGitHub {
owner = "ocornut";
repo = "imgui";
tag = "v${version}";
hash = "sha256-0k9jKrJUrG9piHNFQaBBY3zgNIKM23ZA879NY+MNYTU=";
};
patch = fetchurl {
url = "https://wrapdb.mesonbuild.com/v2/imgui_${version}-1/get_patch";
hash = "sha256-myEpDFl9dr+NTus/n/oCSxHZ6mxh6R1kjMyQtChD1YQ=";
};
};
# Derived from subprojects/implot.wrap
implot = rec {
version = "0.16";
src = fetchFromGitHub {
owner = "epezent";
repo = "implot";
tag = "v${version}";
hash = "sha256-/wkVsgz3wiUVZBCgRl2iDD6GWb+AoHN+u0aeqHHgem0=";
};
patch = fetchurl {
url = "https://wrapdb.mesonbuild.com/v2/implot_${version}-1/get_patch";
hash = "sha256-HGsUYgZqVFL6UMHaHdR/7YQfKCMpcsgtd48pYpNlaMc=";
};
};
# Derived from subprojects/vulkan-headers.wrap
vulkan-headers = rec {
version = "1.2.158";
src = fetchFromGitHub {
owner = "KhronosGroup";
repo = "Vulkan-Headers";
tag = "v${version}";
hash = "sha256-5uyk2nMwV1MjXoa3hK/WUeGLwpINJJEvY16kc5DEaks=";
};
patch = fetchurl {
url = "https://wrapdb.mesonbuild.com/v2/vulkan-headers_${version}-2/get_patch";
hash = "sha256-hgNYz15z9FjNHoj4w4EW0SOrQh1c4uQSnsOOrt2CDhc=";
};
};
in
stdenv.mkDerivation (finalAttrs: {
pname = "mangohud";
version = "0.8.1";
src = fetchFromGitHub {
owner = "flightlessmango";
repo = "MangoHud";
tag = "v${finalAttrs.version}";
fetchSubmodules = true;
hash = "sha256-FvPhnOvcYE8vVB5R+ZRmuZxrC9U4GA338V7VAuUlHCE=";
};
outputs = [
"out"
"doc"
"man"
];
# Unpack subproject sources
postUnpack = ''
(
cd "$sourceRoot/subprojects"
cp -R --no-preserve=mode,ownership ${imgui.src} imgui-${imgui.version}
cp -R --no-preserve=mode,ownership ${implot.src} implot-${implot.version}
cp -R --no-preserve=mode,ownership ${vulkan-headers.src} Vulkan-Headers-${vulkan-headers.version}
)
'';
patches = [
# Add @libraryPath@ template variable to fix loading the preload
# library and @dataPath@ to support overlaying Vulkan apps without
# requiring MangoHud to be installed
./preload-nix-workaround.patch
# Hard code dependencies. Can't use makeWrapper since the Vulkan
# layer can be used without the mangohud executable by setting MANGOHUD=1.
(replaceVars ./hardcode-dependencies.patch {
path = lib.makeBinPath [
coreutils
curl
gnugrep
gnused
xdg-utils
];
libdbus = dbus.lib;
libGL = libGL;
libX11 = libX11;
inherit hwdata;
})
];
postPatch = ''
substituteInPlace bin/mangohud.in \
--subst-var-by libraryPath ${
lib.makeSearchPath "lib/mangohud" (
[
(placeholder "out")
]
++ lib.optional lowerBitnessSupport mangohud32
)
} \
--subst-var-by version "${finalAttrs.version}" \
--subst-var-by dataDir ${placeholder "out"}/share
(
cd subprojects
unzip ${imgui.patch}
unzip ${implot.patch}
unzip ${vulkan-headers.patch}
)
'';
mesonFlags = [
"-Duse_system_spdlog=enabled"
"-Dtests=disabled" # amdgpu test segfaults in nix sandbox
(lib.mesonEnable "with_x11" x11Support)
(lib.mesonEnable "with_wayland" waylandSupport)
(lib.mesonEnable "with_xnvctrl" nvidiaSupport)
(lib.mesonBool "mangoapp" mangoappSupport)
(lib.mesonBool "mangohudctl" mangohudctlSupport)
];
strictDeps = true;
nativeBuildInputs = [
addDriverRunpath
glslang
python3Packages.mako
meson
ninja
pkg-config
unzip
];
buildInputs = [
dbus
nlohmann_json
spdlog
]
++ lib.optional waylandSupport wayland
++ lib.optional x11Support libX11
++ lib.optional nvidiaSupport libXNVCtrl
++ lib.optional (x11Support || waylandSupport) libxkbcommon
++ lib.optionals mangoappSupport [
glew
glfw
libXrandr
];
doCheck = true;
nativeCheckInputs = [
appstream
];
# Support 32bit Vulkan applications by linking in 32bit Vulkan layers
# This is needed for the same reason the 32bit preload workaround is needed.
postInstall = lib.optionalString lowerBitnessSupport ''
ln -s ${mangohud32}/share/vulkan/implicit_layer.d/MangoHud.x86.json \
"$out/share/vulkan/implicit_layer.d"
'';
postFixup =
let
archMap = {
"x86_64-linux" = "x86_64";
"i686-linux" = "x86";
};
layerPlatform = archMap."${stdenv.hostPlatform.system}" or null;
in
# We need to give the different layers separate names or else the loader
# might try the 32-bit one first, fail and not attempt to load the 64-bit
# layer under the same name.
lib.optionalString (layerPlatform != null) ''
substituteInPlace $out/share/vulkan/implicit_layer.d/MangoHud.${layerPlatform}.json \
--replace-fail "VK_LAYER_MANGOHUD_overlay" "VK_LAYER_MANGOHUD_overlay_${toString stdenv.hostPlatform.parsed.cpu.bits}"
''
+ lib.optionalString nvidiaSupport ''
# Add OpenGL driver and libXNVCtrl paths to RUNPATH to support NVIDIA cards
addDriverRunpath "$out/lib/mangohud/libMangoHud.so"
patchelf --add-rpath ${libXNVCtrl}/lib "$out/lib/mangohud/libMangoHud.so"
''
+ lib.optionalString mangoappSupport ''
addDriverRunpath "$out/bin/mangoapp"
'';
passthru.updateScript = nix-update-script { };
meta = with lib; {
description = "Vulkan and OpenGL overlay for monitoring FPS, temperatures, CPU/GPU load and more";
homepage = "https://github.com/flightlessmango/MangoHud";
changelog = "https://github.com/flightlessmango/MangoHud/releases/tag/v${finalAttrs.version}";
platforms = platforms.linux;
license = licenses.mit;
maintainers = with maintainers; [
kira-bruneau
zeratax
];
};
})

View File

@@ -0,0 +1,73 @@
diff --git a/src/dbus.cpp b/src/dbus.cpp
index 7379af1..4eef3fe 100644
--- a/src/dbus.cpp
+++ b/src/dbus.cpp
@@ -152,7 +152,7 @@ bool dbus_manager::get_media_player_metadata(metadata& meta, std::string name) {
}
bool dbus_manager::init_internal() {
- if (!m_dbus_ldr.IsLoaded() && !m_dbus_ldr.Load("libdbus-1.so.3")) {
+ if (!m_dbus_ldr.IsLoaded() && !m_dbus_ldr.Load("@libdbus@/lib/libdbus-1.so.3")) {
SPDLOG_ERROR("Could not load libdbus-1.so.3");
return false;
}
diff --git a/src/loaders/loader_glx.cpp b/src/loaders/loader_glx.cpp
index aa453b8..0f6479d 100644
--- a/src/loaders/loader_glx.cpp
+++ b/src/loaders/loader_glx.cpp
@@ -23,7 +23,7 @@ bool glx_loader::Load() {
handle = real_dlopen("glxtrace.so", RTLD_LAZY);
#endif
if (!handle)
- handle = real_dlopen("libGL.so.1", RTLD_LAZY);
+ handle = real_dlopen("@libGL@/lib/libGL.so.1", RTLD_LAZY);
if (!handle) {
SPDLOG_ERROR("Failed to open " MANGOHUD_ARCH " libGL.so.1: {}", dlerror());
return false;
diff --git a/src/loaders/loader_x11.cpp b/src/loaders/loader_x11.cpp
index 214fd50..2f08857 100644
--- a/src/loaders/loader_x11.cpp
+++ b/src/loaders/loader_x11.cpp
@@ -110,6 +110,6 @@ static std::shared_ptr<libx11_loader> loader;
std::shared_ptr<libx11_loader> get_libx11()
{
if (!loader)
- loader = std::make_shared<libx11_loader>("libX11.so.6");
+ loader = std::make_shared<libx11_loader>("@libX11@/lib/libX11.so.6");
return loader;
}
diff --git a/src/logging.cpp b/src/logging.cpp
index 4ef7023..e24f6da 100644
--- a/src/logging.cpp
+++ b/src/logging.cpp
@@ -28,8 +28,12 @@ string exec(string command) {
#endif
std::array<char, 128> buffer;
std::string result;
+
+ char* originalPath = getenv("PATH");
+ setenv("PATH", "@path@", 1);
auto deleter = [](FILE* ptr){ pclose(ptr); };
std::unique_ptr<FILE, decltype(deleter)> pipe(popen(command.c_str(), "r"), deleter);
+ setenv("PATH", originalPath, 1);
if (!pipe) {
return "popen failed!";
}
diff --git a/src/pci_ids.cpp b/src/pci_ids.cpp
index 002a843..5a6262b 100644
--- a/src/pci_ids.cpp
+++ b/src/pci_ids.cpp
@@ -24,11 +24,9 @@ static std::istream& get_uncommented_line(std::istream& is, std::string &line)
void parse_pciids()
{
std::ifstream file;
- file.open("/usr/share/hwdata/pci.ids");
+ file.open("@hwdata@/share/hwdata/pci.ids");
if (file.fail()){
- file.open("/usr/share/misc/pci.ids");
- if (file.fail())
- SPDLOG_ERROR("can't find file pci.ids");
+ SPDLOG_ERROR("can't find file pci.ids");
}
std::string line;

View File

@@ -0,0 +1,31 @@
diff --git a/bin/mangohud.in b/bin/mangohud.in
index 4cffeed..c19b635 100755
--- a/bin/mangohud.in
+++ b/bin/mangohud.in
@@ -13,7 +13,9 @@ fi
DISABLE_LD_PRELOAD="cs2.sh
"
-MANGOHUD_LIB_NAME="@ld_libdir_mangohud@libMangoHud_shim.so"
+LD_LIBRARY_PATH="@libraryPath@${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}"
+XDG_DATA_DIRS="@dataDir@${XDG_DATA_DIRS:+:$XDG_DATA_DIRS}"
+MANGOHUD_LIB_NAME="libMangoHud_shim.so"
if [ "$1" = "--version" ]; then
echo @version@
@@ -39,7 +41,7 @@ for exe in $DISABLE_LD_PRELOAD; do
done
if [ "$disable_preload" = true ]; then
- exec env MANGOHUD=1 "$@"
+ exec env MANGOHUD=1 LD_LIBRARY_PATH="${LD_LIBRARY_PATH}" XDG_DATA_DIRS="${XDG_DATA_DIRS}" "$@"
else
# Make sure we don't append mangohud lib multiple times
# otherwise, this could cause issues with the steam runtime
@@ -52,5 +54,5 @@ else
LD_PRELOAD="${LD_PRELOAD:+$LD_PRELOAD:}${MANGOHUD_LIB_NAME}"
esac
- exec env MANGOHUD=1 LD_PRELOAD="${LD_PRELOAD}" "$@"
+ exec env MANGOHUD=1 LD_PRELOAD="${LD_PRELOAD}" LD_LIBRARY_PATH="${LD_LIBRARY_PATH}" XDG_DATA_DIRS="${XDG_DATA_DIRS}" "$@"
fi

View File

@@ -0,0 +1,44 @@
{
lib,
stdenv,
fetchFromGitHub,
cmake,
qtbase,
qt6,
wrapQtAppsHook,
}:
stdenv.mkDerivation rec {
pname = "maskromtool";
version = "2024-08-18";
src = fetchFromGitHub {
owner = "travisgoodspeed";
repo = "maskromtool";
rev = "v${version}";
hash = "sha256-iuCjAAVEKVwJuAgKITwkXGhKau2DVWhFQLPjp28tjIo=";
};
buildInputs = [
qtbase
qt6.qtcharts
qt6.qttools
];
nativeBuildInputs = [
cmake
wrapQtAppsHook
];
meta = {
description = "CAD tool for extracting bits from Mask ROM photographs";
homepage = "https://github.com/travisgoodspeed/maskromtool";
license = [
lib.licenses.beerware
lib.licenses.gpl1Plus
];
maintainers = [
lib.maintainers.evanrichter
];
};
}

View File

@@ -0,0 +1,89 @@
{
lib,
stdenv,
fetchFromGitHub,
qmake,
qtbase,
qttools,
replaceVars,
libGLU,
zlib,
wrapQtAppsHook,
fetchpatch,
}:
stdenv.mkDerivation {
pname = "nifskope";
version = "2.0.dev7";
src = fetchFromGitHub {
owner = "niftools";
repo = "nifskope";
rev = "47b788d26ae0fa12e60e8e7a4f0fa945a510c7b2"; # `v${version}` doesn't work with submodules
hash = "sha256-8TNXDSZ3okeMtuGEHpKOnKyY/Z/w4auG5kjgmUexF/M=";
fetchSubmodules = true;
};
patches = [
./external-lib-paths.patch
./zlib.patch
(replaceVars ./qttools-bins.patch {
qttools = "${qttools.dev}/bin";
})
(fetchpatch {
name = "qt512-build-fix.patch";
url = "https://github.com/niftools/nifskope/commit/30954e7f01f3d779a2a1fd37d363e8a6ad560bd3.patch";
sha256 = "0d6xjj2mjjhdd7w1aig5f75jksjni16jyj0lxsz51pys6xqb6fpj";
})
]
++ (lib.optional stdenv.hostPlatform.isAarch64 ./no-sse-on-arm.patch);
buildInputs = [
qtbase
qttools
libGLU
zlib
];
nativeBuildInputs = [
qmake
wrapQtAppsHook
];
preConfigure = ''
shopt -s globstar
for i in **/*.cpp; do
substituteInPlace $i --replace /usr/share/nifskope $out/share/nifskope
done
'';
# Inspired by install/linux-install/nifskope.spec.in.
installPhase = ''
runHook preInstall
d=$out/share/nifskope
mkdir -p $out/bin $out/share/applications $out/share/pixmaps $d/{shaders,lang}
cp release/NifSkope $out/bin/
cp ./res/nifskope.png $out/share/pixmaps/
cp release/{nif.xml,kfm.xml,style.qss} $d/
cp res/shaders/*.frag res/shaders/*.prog res/shaders/*.vert $d/shaders/
cp ./res/lang/*.ts ./res/lang/*.tm $d/lang/
cp ./install/linux-install/nifskope.desktop $out/share/applications
substituteInPlace $out/share/applications/nifskope.desktop \
--replace 'Exec=nifskope' "Exec=$out/bin/NifSkope" \
--replace 'Icon=nifskope' "Icon=$out/share/pixmaps/nifskope.png"
find $out/share -type f -exec chmod -x {} \;
runHook postInstall
'';
meta = with lib; {
homepage = "https://github.com/niftools/nifskope";
description = "Tool for analyzing and editing NetImmerse/Gamebryo '*.nif' files";
maintainers = [ ];
platforms = platforms.linux;
license = licenses.bsd3;
mainProgram = "NifSkope";
};
}

View File

@@ -0,0 +1,33 @@
diff --git a/NifSkope.pro b/NifSkope.pro
index 1c0bc5a..cc29fc5 100644
--- a/NifSkope.pro
+++ b/NifSkope.pro
@@ -330,14 +330,14 @@ nvtristrip {
}
qhull {
- !*msvc*:QMAKE_CFLAGS += -isystem ../nifskope/lib/qhull/src
- !*msvc*:QMAKE_CXXFLAGS += -isystem ../nifskope/lib/qhull/src
+ !*msvc*:QMAKE_CFLAGS += -isystem ./lib/qhull/src
+ !*msvc*:QMAKE_CXXFLAGS += -isystem ./lib/qhull/src
else:INCLUDEPATH += lib/qhull/src
HEADERS += $$files($$PWD/lib/qhull/src/libqhull/*.h, false)
}
gli {
- !*msvc*:QMAKE_CXXFLAGS += -isystem ../nifskope/lib/gli/gli -isystem ../nifskope/lib/gli/external
+ !*msvc*:QMAKE_CXXFLAGS += -isystem ./lib/gli/gli -isystem ./lib/gli/external
else:INCLUDEPATH += lib/gli/gli lib/gli/external
HEADERS += $$files($$PWD/lib/gli/gli/*.hpp, true)
HEADERS += $$files($$PWD/lib/gli/gli/*.inl, true)
@@ -346,8 +346,8 @@ gli {
}
zlib {
- !*msvc*:QMAKE_CFLAGS += -isystem ../nifskope/lib/zlib
- !*msvc*:QMAKE_CXXFLAGS += -isystem ../nifskope/lib/zlib
+ !*msvc*:QMAKE_CFLAGS += -isystem ./lib/zlib
+ !*msvc*:QMAKE_CXXFLAGS += -isystem ./lib/zlib
else:INCLUDEPATH += lib/zlib
HEADERS += $$files($$PWD/lib/zlib/*.h, false)
SOURCES += $$files($$PWD/lib/zlib/*.c, false)

View File

@@ -0,0 +1,19 @@
diff --git a/NifSkope.pro b/NifSkope.pro
index cc29fc5..b17bb6e 100644
--- a/NifSkope.pro
+++ b/NifSkope.pro
@@ -428,13 +428,10 @@ win32 {
# Optimization flags
QMAKE_CXXFLAGS_DEBUG -= -O0 -g
QMAKE_CXXFLAGS_DEBUG *= -Og -g3
- QMAKE_CXXFLAGS_RELEASE *= -O3 -mfpmath=sse
+ QMAKE_CXXFLAGS_RELEASE *= -O3
# C++11 Support
QMAKE_CXXFLAGS_RELEASE *= -std=c++14
-
- # Extension flags
- QMAKE_CXXFLAGS_RELEASE *= -msse2 -msse
}
win32 {

View File

@@ -0,0 +1,22 @@
diff --git a/NifSkope_targets.pri b/NifSkope_targets.pri
index 05324c2..d8389b1 100644
--- a/NifSkope_targets.pri
+++ b/NifSkope_targets.pri
@@ -11,7 +11,7 @@ else:EXE = ""
## lupdate / lrelease
###############################
-QMAKE_LUPDATE = $$[QT_INSTALL_BINS]/lupdate$${EXE}
+QMAKE_LUPDATE = @qttools@/lupdate$${EXE}
exists($$QMAKE_LUPDATE) {
# Make target for Updating .ts
updatets.target = updatets
@@ -23,7 +23,7 @@ exists($$QMAKE_LUPDATE) {
message("lupdate could not be found, ignoring make target")
}
-QMAKE_LRELEASE = $$[QT_INSTALL_BINS]/lrelease$${EXE}
+QMAKE_LRELEASE = @qttools@/lrelease$${EXE}
exists($$QMAKE_LRELEASE) {
# Build Step for Releasing .ts->.qm
updateqm.input = TRANSLATIONS

View File

@@ -0,0 +1,39 @@
diff --git a/NifSkope.pro b/NifSkope.pro
index 89b8471f6410..8e136ddf44c6 100644
--- a/NifSkope.pro
+++ b/NifSkope.pro
@@ -17,7 +17,7 @@ contains(QT_VERSION, ^5\\.[0-6]\\..*) {
CONFIG += c++14
# Dependencies
-CONFIG += nvtristrip qhull zlib lz4 fsengine gli
+CONFIG += nvtristrip qhull lz4 fsengine gli
# Debug/Release options
CONFIG(debug, debug|release) {
@@ -345,14 +345,6 @@ gli {
HEADERS += $$files($$PWD/lib/gli/external/glm/*.inl, true)
}
-zlib {
- !*msvc*:QMAKE_CFLAGS += -isystem ./lib/zlib
- !*msvc*:QMAKE_CXXFLAGS += -isystem ./lib/zlib
- else:INCLUDEPATH += lib/zlib
- HEADERS += $$files($$PWD/lib/zlib/*.h, false)
- SOURCES += $$files($$PWD/lib/zlib/*.c, false)
-}
-
lz4 {
DEFINES += LZ4_STATIC XXH_PRIVATE_API
@@ -442,6 +434,10 @@ win32 {
LIBS += -lopengl32 -lglu32
}
+unix {
+ LIBS += -lz
+}
+
unix:!macx {
LIBS += -lGLU
}

View File

@@ -0,0 +1,90 @@
{
lib,
stdenv,
mkDerivation,
fetchurl,
cmake,
pkg-config,
openexr,
zlib,
imagemagick6,
libGLU,
libGL,
libglut,
fftwFloat,
fftw,
gsl,
libexif,
perl,
qtbase,
netpbm,
enableUnfree ? false,
opencv,
}:
mkDerivation rec {
pname = "pfstools";
version = "2.2.0";
src = fetchurl {
url = "mirror://sourceforge/${pname}/${version}/${pname}-${version}.tgz";
sha256 = "sha256-m/aESYVmMibCGZjutDwmGsuOSziRuakbcpVUQGKJ18o=";
};
outputs = [
"out"
"dev"
"man"
];
cmakeFlags = [ "-DWITH_MATLAB=false" ];
preConfigure = ''
sed -e 's|#include( ''${PROJECT_SRC_DIR}/cmake/FindNETPBM.cmake )|include( ''${PROJECT_SOURCE_DIR}/cmake/FindNETPBM.cmake )|' -i CMakeLists.txt
rm cmake/FindNETPBM.cmake
echo "SET(NETPBM_LIBRARY `find ${lib.getLib netpbm} -name "*${stdenv.hostPlatform.extensions.sharedLibrary}*" -type f`)" >> cmake/FindNETPBM.cmake
echo "SET(NETPBM_LIBRARIES `find ${lib.getLib netpbm} -name "*${stdenv.hostPlatform.extensions.sharedLibrary}*" -type f`)" >> cmake/FindNETPBM.cmake
echo "SET(NETPBM_INCLUDE_DIR ${lib.getDev netpbm}/include/netpbm)" >> cmake/FindNETPBM.cmake
echo "INCLUDE(FindPackageHandleStandardArgs)" >> cmake/FindNETPBM.cmake
echo "FIND_PACKAGE_HANDLE_STANDARD_ARGS(NETPBM DEFAULT_MSG NETPBM_LIBRARY NETPBM_INCLUDE_DIR)" >> cmake/FindNETPBM.cmake
'';
nativeBuildInputs = [
cmake
pkg-config
];
buildInputs = [
openexr
zlib
imagemagick6
fftwFloat
fftw
gsl
libexif
perl
qtbase
netpbm
]
++ lib.optionals (!stdenv.hostPlatform.isDarwin) [
libGLU
libGL
libglut
]
++ lib.optional enableUnfree (opencv.override { enableUnfree = true; });
patches = [
./glut.patch
./threads.patch
./pfstools.patch
./pfsalign.patch
];
meta = with lib; {
homepage = "https://pfstools.sourceforge.net/";
description = "Toolkit for manipulation of HDR images";
platforms = platforms.linux;
license = licenses.lgpl2;
maintainers = [ maintainers.juliendehos ];
};
}

View File

@@ -0,0 +1,12 @@
--- a/src/pfsglview/CMakeLists.txt 2022-04-04 23:21:11.164016369 +0300
+++ b/src/pfsglview/CMakeLists.txt 2022-04-04 23:21:32.757878750 +0300
@@ -11,8 +11,7 @@
add_executable(pfsglview pfsglview.cpp picture_io.cpp module.cpp m_histogram.cpp m_status.cpp m_on_screen_display.cpp)
-# TODO: Use ${GLUT_LIBRARY} instead.
-target_link_libraries(pfsglview ${OPENGL_LIBRARIES} ${GLUT_glut_LIBRARY} pfs)
+target_link_libraries(pfsglview ${OPENGL_LIBRARIES} ${GLUT_LIBRARIES} pfs)
install (TARGETS pfsglview DESTINATION bin)
install (FILES pfsglview.1 DESTINATION ${MAN_DIR})

View File

@@ -0,0 +1,12 @@
--- a/src/camera/CMakeLists.txt 2017-11-13 18:38:27.000000000 +0100
+++ b/src/camera/CMakeLists.txt 2018-12-30 14:55:30.235571520 +0100
@@ -9,7 +9,7 @@ target_link_libraries(${TRG} pfs)
install (TARGETS ${TRG} DESTINATION bin)
install (FILES ${TRG}.1 DESTINATION ${MAN_DIR})
-if( OpenCV_FOUND AND EXIF_FOUND )
+if( OpenCV_FOUND AND MYPKG_FOUND )
set(TRG pfsalign)
add_executable(${TRG} ${TRG}.cpp "${GETOPT_OBJECT}")

View File

@@ -0,0 +1,21 @@
--- a/CMakeLists.txt 2016-05-26 11:31:16.000000000 +0200
+++ b/CMakeLists.txt 2016-07-22 19:07:22.074669909 +0200
@@ -320,12 +320,12 @@
# ======== libexif ==========
-find_package(EXIF)
-if( NOT EXIF_FOUND )
- message( "EXIF library (libexif) not found. 'pfsalign' will not be compiled" )
-else( NOT EXIF_FOUND )
- message(STATUS "libexif library found.")
-endif( NOT EXIF_FOUND )
+find_package( PkgConfig REQUIRED )
+pkg_check_modules( MYPKG REQUIRED libexif IlmBase )
+if( MYPKG_FOUND )
+ message( STATUS "libexif and IlmBase found." )
+endif( MYPKG_FOUND )
+include_directories( ${MYPKG_INCLUDE_DIRS} )
# ======== Config and sub dirs ===========

View File

@@ -0,0 +1,20 @@
--- a/src/fileformat/CMakeLists.txt 2016-05-26 11:31:23.000000000 +0200
+++ b/src/fileformat/CMakeLists.txt 2016-07-21 23:19:56.510958771 +0200
@@ -53,13 +53,15 @@
if( OPENEXR_FOUND )
include_directories("${OPENEXR_INCLUDE_DIR}")
+ find_package (Threads)
+
add_executable(pfsinexr pfsinexr.cpp "${GETOPT_OBJECT}")
- target_link_libraries(pfsinexr pfs ${OPENEXR_LIBRARIES})
+ target_link_libraries(pfsinexr pfs ${OPENEXR_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT})
install (TARGETS pfsinexr DESTINATION bin)
install (FILES pfsinexr.1 DESTINATION ${MAN_DIR})
add_executable(pfsoutexr pfsoutexr.cpp "${GETOPT_OBJECT}")
- target_link_libraries(pfsoutexr pfs ${OPENEXR_LIBRARIES})
+ target_link_libraries(pfsoutexr pfs ${OPENEXR_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT})
install (TARGETS pfsoutexr DESTINATION bin)
install (FILES pfsoutexr.1 DESTINATION ${MAN_DIR})
endif( OPENEXR_FOUND )

View File

@@ -0,0 +1,31 @@
{
lib,
buildPythonPackage,
fetchurl,
pillow,
svgwrite,
}:
buildPythonPackage rec {
pname = "pixel2svg";
version = "0.3.0";
format = "setuptools";
src = fetchurl {
url = "https://static.florian-berger.de/pixel2svg-${version}.zip";
sha256 = "sha256-aqcTTmZKcdRdVd8GGz5cuaQ4gjPapVJNtiiZu22TZgQ=";
};
propagatedBuildInputs = [
pillow
svgwrite
];
meta = with lib; {
homepage = "https://florian-berger.de/en/software/pixel2svg/";
description = "Converts pixel art to SVG - pixel by pixel";
license = licenses.gpl3Plus;
maintainers = with maintainers; [ annaaurora ];
mainProgram = "pixel2svg.py";
};
}

View File

@@ -0,0 +1,38 @@
{
mkDerivation,
lib,
fetchFromGitHub,
qmake,
qtbase,
}:
mkDerivation {
pname = "rocket";
version = "2018-06-09";
src = fetchFromGitHub {
owner = "rocket";
repo = "rocket";
rev = "7bc1e9826cad5dbc63e56371c6aa1798b2a7b50b";
sha256 = "13bdg2dc6ypk17sz39spqdlb3wai2y085bdb36pls2as2nf22drp";
};
nativeBuildInputs = [ qmake ];
buildInputs = [ qtbase ];
dontConfigure = true;
installPhase = ''
mkdir -p $out/bin
cp -r editor/editor $out/bin/
'';
meta = with lib; {
description = "Tool for synchronizing music and visuals in demoscene productions";
mainProgram = "editor";
homepage = "https://github.com/rocket/rocket";
license = licenses.zlib;
platforms = platforms.linux;
maintainers = [ maintainers.dezgeg ];
};
}

View File

@@ -0,0 +1,41 @@
{
lib,
stdenv,
fetchFromGitHub,
libGL,
libGLU,
libglut,
libX11,
}:
stdenv.mkDerivation rec {
pname = "twilight";
version = "unstable-2018-04-19";
src = fetchFromGitHub {
owner = "tweakoz";
repo = "twilight";
rev = "43f21d15c2a8923c9d707bdf3789f480bfd4b36d";
sha256 = "0mmmi4jj8yd8wnah6kx5na782sjycszgzim33dfalr0ph361m4pz";
};
buildInputs = [
libGL
libGLU
libglut
libX11
];
installPhase = ''
install -Dm755 twilight $out/bin/twilight
'';
meta = with lib; {
description = "Redo of IRIX twilight backdrop in old school OpenGL";
homepage = src.meta.homepage;
license = licenses.mit;
platforms = platforms.linux;
maintainers = [ ];
mainProgram = "twilight";
};
}

View File

@@ -0,0 +1,61 @@
{
lib,
stdenv,
fetchFromGitHub,
glslang,
meson,
ninja,
pkg-config,
libX11,
spirv-headers,
vulkan-headers,
vkbasalt32,
}:
stdenv.mkDerivation (finalAttrs: {
pname = "vkbasalt";
version = "0.3.2.10";
src = fetchFromGitHub {
owner = "DadSchoorse";
repo = "vkBasalt";
tag = "v${finalAttrs.version}";
hash = "sha256-GC6JKYnsfcUBg+CX6v7MyE4FeLmjadFwighaiyureDg=";
};
nativeBuildInputs = [
glslang
meson
ninja
pkg-config
];
buildInputs = [
libX11
spirv-headers
vulkan-headers
];
mesonFlags = [ "-Dappend_libdir_vkbasalt=true" ];
postInstall = lib.optionalString (stdenv.hostPlatform.system == "x86_64-linux") ''
install -Dm 644 $src/config/vkBasalt.conf $out/share/vkBasalt/vkBasalt.conf
# Include 32bit layer in 64bit build
ln -s ${vkbasalt32}/share/vulkan/implicit_layer.d/vkBasalt.json \
"$out/share/vulkan/implicit_layer.d/vkBasalt32.json"
'';
# We need to give the different layers separate names or else the loader
# might try the 32-bit one first, fail and not attempt to load the 64-bit
# layer under the same name.
postFixup = ''
substituteInPlace "$out/share/vulkan/implicit_layer.d/vkBasalt.json" \
--replace "VK_LAYER_VKBASALT_post_processing" "VK_LAYER_VKBASALT_post_processing_${toString stdenv.hostPlatform.parsed.cpu.bits}"
'';
meta = with lib; {
description = "Vulkan post processing layer for Linux";
homepage = "https://github.com/DadSchoorse/vkBasalt";
license = licenses.zlib;
maintainers = with maintainers; [ kira-bruneau ];
platforms = platforms.linux;
};
})

View File

@@ -0,0 +1,65 @@
{
lib,
stdenv,
fetchFromGitHub,
qmake,
vulkan-loader,
wayland,
wrapQtAppsHook,
x11Support ? true,
qtx11extras,
}:
stdenv.mkDerivation rec {
pname = "vulkan-caps-viewer";
version = "4.02";
src = fetchFromGitHub {
owner = "SaschaWillems";
repo = "VulkanCapsViewer";
rev = version;
hash = "sha256-89W/1E9IJaPUzeki0vegXzprGFAFIgb1mRx0OMC4+ec=";
# Note: this derivation strictly requires vulkan-header to be the same it was developed against.
# To help us, they've put it in a git-submodule.
# The result will work with any vulkan-loader version.
fetchSubmodules = true;
};
nativeBuildInputs = [
qmake
wrapQtAppsHook
];
buildInputs = [
vulkan-loader
wayland
]
++ lib.lists.optionals x11Support [ qtx11extras ];
patchPhase = ''
substituteInPlace vulkanCapsViewer.pro \
--replace '/usr/' "/"
'';
qmakeFlags = [
"CONFIG+=release"
];
installFlags = [ "INSTALL_ROOT=$(out)" ];
meta = with lib; {
mainProgram = "vulkanCapsViewer";
description = "Vulkan hardware capability viewer";
longDescription = ''
Client application to display hardware implementation details for GPUs supporting the Vulkan API by Khronos.
The hardware reports can be submitted to a public online database that allows comparing different devices, browsing available features, extensions, formats, etc.
'';
homepage = "https://vulkan.gpuinfo.org/";
platforms = platforms.unix;
license = licenses.gpl2Only;
maintainers = with maintainers; [ pedrohlc ];
changelog = "https://github.com/SaschaWillems/VulkanCapsViewer/releases/tag/${version}";
# never built on aarch64-darwin, x86_64-darwin since first introduction in nixpkgs
broken = stdenv.hostPlatform.isDarwin;
};
}

View File

@@ -0,0 +1,179 @@
{
stdenv,
lib,
fetchFromGitHub,
fetchpatch,
imagemagickBig,
pkg-config,
withXorg ? true,
libX11,
libv4l,
qtbase,
qtx11extras,
wrapQtAppsHook,
wrapGAppsHook3,
gtk3,
xmlto,
docbook_xsl,
autoreconfHook,
dbus,
enableVideo ? stdenv.hostPlatform.isLinux,
# The implementation is buggy and produces an error like
# Name Error (Connection ":1.4380" is not allowed to own the service "org.linuxtv.Zbar" due to security policies in the configuration file)
# for every scanned code.
# see https://github.com/mchehab/zbar/issues/104
enableDbus ? false,
libintl,
libiconv,
bash,
python3,
argp-standalone,
}:
stdenv.mkDerivation rec {
pname = "zbar";
version = "0.23.93";
outputs = [
"out"
"lib"
"dev"
"doc"
"man"
];
src = fetchFromGitHub {
owner = "mchehab";
repo = "zbar";
rev = version;
sha256 = "sha256-6gOqMsmlYy6TK+iYPIBsCPAk8tYDliZYMYeTOidl4XQ=";
};
patches = [
# Fix build, remove these two patches on a release beyond 0.23.93.
(fetchpatch {
name = "variable-pkg-config-path.patch";
url = "https://github.com/mchehab/zbar/commit/368571ffa1a0f6cc41f708dd0d27f9b6e9409df8.patch";
hash = "sha256-4VEuGAyR7rcIijPLlh4pzL82ESm99Wb35PV/FbY9H6Y=";
})
(fetchpatch {
name = "qt5-detection-fix.patch";
url = "https://github.com/mchehab/zbar/commit/a549566ea11eb03622bd4458a1728ffe3f589163.patch";
hash = "sha256-NY3bAElwNvGP9IR6JxUf62vbjx3hONrqu9pMSqaZcLY=";
})
];
nativeBuildInputs = [
pkg-config
xmlto
autoreconfHook
docbook_xsl
]
++ lib.optionals enableVideo [
wrapGAppsHook3
wrapQtAppsHook
qtbase
];
buildInputs = [
imagemagickBig
libintl
]
++ lib.optionals stdenv.hostPlatform.isDarwin [
libiconv
]
++ lib.optionals enableDbus [
dbus
]
++ lib.optionals withXorg [
libX11
]
++ lib.optionals enableVideo [
libv4l
gtk3
qtbase
qtx11extras
];
nativeCheckInputs = [
bash
python3
];
checkInputs = lib.optionals stdenv.hostPlatform.isDarwin [
argp-standalone
];
# fix iconv linking on macOS
preConfigure = lib.optionalString stdenv.hostPlatform.isDarwin ''
export LDFLAGS="-liconv"
'';
# Note: postConfigure instead of postPatch in order to include some
# autoconf-generated files. The template files for the autogen'd scripts are
# not chmod +x, so patchShebangs misses them.
postConfigure = ''
patchShebangs test
'';
# Disable assertions which include -dev QtBase file paths.
env.NIX_CFLAGS_COMPILE = "-DQT_NO_DEBUG";
configureFlags = [
"--without-python"
]
++ (
if enableDbus then
[
"--with-dbusconfdir=${placeholder "out"}/share"
]
else
[
"--without-dbus"
]
)
++ (
if enableVideo then
[
"--with-gtk=gtk3"
]
else
[
"--disable-video"
"--without-gtk"
"--without-qt"
]
);
doCheck = true;
preCheck = lib.optionalString stdenv.hostPlatform.isDarwin ''
export NIX_LDFLAGS="$NIX_LDFLAGS -largp"
'';
dontWrapQtApps = true;
dontWrapGApps = true;
postFixup = lib.optionalString enableVideo ''
wrapGApp "$out/bin/zbarcam-gtk"
wrapQtApp "$out/bin/zbarcam-qt"
'';
enableParallelBuilding = true;
meta = with lib; {
description = "Bar code reader";
longDescription = ''
ZBar is an open source software suite for reading bar codes from various
sources, such as video streams, image files and raw intensity sensors. It
supports many popular symbologies (types of bar codes) including
EAN-13/UPC-A, UPC-E, EAN-8, Code 128, Code 39, Interleaved 2 of 5 and QR
Code.
'';
maintainers = with maintainers; [ raskin ];
platforms = platforms.unix;
license = licenses.lgpl21;
homepage = "https://github.com/mchehab/zbar";
mainProgram = "zbarimg";
};
}