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,85 @@
{
lib,
stdenv,
fetchFromGitHub,
unstableGitUpdater,
cmake,
pkg-config,
alsa-lib,
jack2,
libpulseaudio,
sndio,
speexdsp,
validatePkgConfig,
# passthru.tests
testers,
alsaSupport ? !stdenv.hostPlatform.isDarwin,
pulseSupport ? !stdenv.hostPlatform.isDarwin,
jackSupport ? !stdenv.hostPlatform.isDarwin,
sndioSupport ? !stdenv.hostPlatform.isDarwin,
enableShared ? !stdenv.hostPlatform.isStatic,
}:
stdenv.mkDerivation (finalAttrs: {
pname = "cubeb";
version = "0-unstable-2025-09-17";
src = fetchFromGitHub {
owner = "mozilla";
repo = "cubeb";
rev = "e495bee4cd630c9f99907a764e16edba37a4b564";
hash = "sha256-iBxYZppjJhFAwGi9v4/lTsyqC9Gy04Dc7bJNzgv18rE=";
};
outputs = [
"out"
"lib"
"dev"
];
nativeBuildInputs = [
cmake
pkg-config
validatePkgConfig
];
buildInputs = [
speexdsp
]
# In the default configuration these inputs are lazy-loaded. If your package builds a vendored cubeb please make
# sure to include these in the runtime LD path.
++ lib.optional alsaSupport alsa-lib
++ lib.optional jackSupport jack2
++ lib.optional pulseSupport libpulseaudio
++ lib.optional sndioSupport sndio;
cmakeFlags = [
(lib.cmakeBool "BUILD_SHARED_LIBS" enableShared)
(lib.cmakeBool "BUILD_TESTS" false) # tests require an audio server
(lib.cmakeBool "BUNDLE_SPEEX" false)
(lib.cmakeBool "USE_SANITIZERS" false)
# Whether to lazily load libraries with dlopen()
(lib.cmakeBool "LAZY_LOAD_LIBS" false)
];
passthru = {
updateScript = unstableGitUpdater { hardcodeZeroVersion = true; };
tests.pkg-config = testers.testMetaPkgConfig finalAttrs.finalPackage;
};
meta = {
description = "Cross platform audio library";
mainProgram = "cubeb-test";
homepage = "https://github.com/mozilla/cubeb";
license = lib.licenses.isc;
platforms = with lib.platforms; linux ++ darwin;
maintainers = with lib.maintainers; [
zhaofengli
marcin-serwin
];
pkgConfigModules = [ "libcubeb" ];
};
})

View File

@@ -0,0 +1,70 @@
{
lib,
stdenv,
fetchFromGitHub,
fetchpatch,
cmake,
fftw,
hamlib,
libpulseaudio,
libGL,
libX11,
liquid-dsp,
pkg-config,
soapysdr-with-plugins,
wxGTK32,
enableDigitalLab ? false,
}:
stdenv.mkDerivation rec {
pname = "cubicsdr";
version = "0.2.7";
src = fetchFromGitHub {
owner = "cjcliffe";
repo = "CubicSDR";
rev = version;
sha256 = "0cyv1vk97x4i3h3hhh7dx8mv6d1ad0fypdbx5fl26bz661sr8j2n";
};
patches = [
# Fix for liquid-dsp v1.50
(fetchpatch {
url = "https://github.com/cjcliffe/CubicSDR/commit/0e3a785bd2af56d18ff06b56579197b3e89b34ab.patch";
sha256 = "sha256-mPfNZcV3FnEtGVX4sCMSs+Qc3VeSBIRkpCyx24TKkcU=";
})
];
nativeBuildInputs = [
cmake
pkg-config
];
buildInputs = [
fftw
hamlib
liquid-dsp
soapysdr-with-plugins
wxGTK32
]
++ lib.optionals stdenv.hostPlatform.isLinux [
libpulseaudio
libGL
libX11
];
cmakeFlags = [ "-DUSE_HAMLIB=ON" ] ++ lib.optional enableDigitalLab "-DENABLE_DIGITAL_LAB=ON";
postFixup = lib.optionalString stdenv.hostPlatform.isDarwin ''
install_name_tool -change libliquid.dylib ${lib.getLib liquid-dsp}/lib/libliquid.dylib ''${out}/bin/CubicSDR
'';
meta = with lib; {
homepage = "https://cubicsdr.com";
description = "Software Defined Radio application";
license = licenses.gpl2Plus;
maintainers = with maintainers; [ lasandell ];
platforms = platforms.unix;
mainProgram = "CubicSDR";
};
}

View File

@@ -0,0 +1,76 @@
{
lib,
stdenv,
fetchFromGitHub,
qt5,
}:
stdenv.mkDerivation (finalAttrs: {
pname = "cubiomes-viewer";
version = "4.1.2";
src = fetchFromGitHub {
owner = "Cubitect";
repo = "cubiomes-viewer";
tag = finalAttrs.version;
hash = "sha256-izDKS08LNT2rV5rIxlWRHevJAKEbAVzekjfZy0Oen1I=";
fetchSubmodules = true;
};
postPatch = ''
substituteInPlace cubiomes-viewer.pro \
--replace '$$[QT_INSTALL_BINS]/lupdate' lupdate \
--replace '$$[QT_INSTALL_BINS]/lrelease' lrelease
'';
buildInputs = [
qt5.qtbase
];
nativeBuildInputs = [
qt5.qmake
qt5.qttools
qt5.wrapQtAppsHook
];
preBuild = ''
# QMAKE_PRE_LINK is not executed (I dont know why)
make -C ./cubiomes libcubiomes CFLAGS="-DSTRUCT_CONFIG_OVERRIDE=1" all
'';
installPhase = ''
runHook preInstall
mkdir -p $out/bin
${
if stdenv.hostPlatform.isDarwin then
''
mkdir -p "$out/Applications/"
cp -R cubiomes-viewer.app "$out/Applications/cubiomes-viewer.app"
ln -s "$out/Applications/cubiomes-viewer.app/Contents/MacOS/cubiomes-viewer" "$out/bin/cubiomes-viewer"
''
else
''
cp cubiomes-viewer $out/bin
mkdir -p $out/share/{pixmaps,applications}
cp rc/icons/map.png $out/share/pixmaps/com.github.cubitect.cubiomes-viewer.png
cp etc/com.github.cubitect.cubiomes-viewer.desktop $out/share/applications
''
}
runHook postInstall
'';
meta = {
homepage = "https://github.com/Cubitect/cubiomes-viewer";
description = "Graphical Minecraft seed finder and map viewer";
mainProgram = "cubiomes-viewer";
longDescription = ''
Cubiomes Viewer provides a graphical interface for the efficient and flexible seed-finding
utilities provided by cubiomes and a map viewer for the Minecraft biomes and structure generation.
'';
platforms = lib.platforms.all;
license = lib.licenses.gpl3Plus;
maintainers = with lib.maintainers; [ hqurve ];
};
})

View File

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

View File

@@ -0,0 +1,45 @@
GEM
remote: https://rubygems.org/
specs:
bigdecimal (3.1.9)
builder (3.3.0)
cucumber (9.2.1)
builder (~> 3.2)
cucumber-ci-environment (> 9, < 11)
cucumber-core (> 13, < 14)
cucumber-cucumber-expressions (~> 17.0)
cucumber-gherkin (> 24, < 28)
cucumber-html-formatter (> 20.3, < 22)
cucumber-messages (> 19, < 25)
diff-lcs (~> 1.5)
mini_mime (~> 1.1)
multi_test (~> 1.1)
sys-uname (~> 1.2)
cucumber-ci-environment (10.0.1)
cucumber-core (13.0.3)
cucumber-gherkin (>= 27, < 28)
cucumber-messages (>= 20, < 23)
cucumber-tag-expressions (> 5, < 7)
cucumber-cucumber-expressions (17.1.0)
bigdecimal
cucumber-gherkin (27.0.0)
cucumber-messages (>= 19.1.4, < 23)
cucumber-html-formatter (21.9.0)
cucumber-messages (> 19, < 28)
cucumber-messages (22.0.0)
cucumber-tag-expressions (6.1.2)
diff-lcs (1.6.2)
ffi (1.17.2)
mini_mime (1.1.5)
multi_test (1.1.0)
sys-uname (1.3.1)
ffi (~> 1.1)
PLATFORMS
ruby
DEPENDENCIES
cucumber
BUNDLED WITH
2.6.6

View File

@@ -0,0 +1,174 @@
{
bigdecimal = {
groups = [ "default" ];
platforms = [ ];
source = {
remotes = [ "https://rubygems.org" ];
sha256 = "1k6qzammv9r6b2cw3siasaik18i6wjc5m0gw5nfdc6jj64h79z1g";
type = "gem";
};
version = "3.1.9";
};
builder = {
groups = [ "default" ];
platforms = [ ];
source = {
remotes = [ "https://rubygems.org" ];
sha256 = "0pw3r2lyagsxkm71bf44v5b74f7l9r7di22brbyji9fwz791hya9";
type = "gem";
};
version = "3.3.0";
};
cucumber = {
dependencies = [
"builder"
"cucumber-ci-environment"
"cucumber-core"
"cucumber-cucumber-expressions"
"cucumber-gherkin"
"cucumber-html-formatter"
"cucumber-messages"
"diff-lcs"
"mini_mime"
"multi_test"
"sys-uname"
];
groups = [ "default" ];
platforms = [ ];
source = {
remotes = [ "https://rubygems.org" ];
sha256 = "0cbi1g6qwdh38z2jxm8a1mc63iz887108747c99s3g452hwn2hgs";
type = "gem";
};
version = "9.2.1";
};
cucumber-ci-environment = {
groups = [ "default" ];
platforms = [ ];
source = {
remotes = [ "https://rubygems.org" ];
sha256 = "0cc6w7dqlmnp59ymi7pyspm3w4m7fn37x6b18pziv62wr373yvmv";
type = "gem";
};
version = "10.0.1";
};
cucumber-core = {
dependencies = [
"cucumber-gherkin"
"cucumber-messages"
"cucumber-tag-expressions"
];
groups = [ "default" ];
platforms = [ ];
source = {
remotes = [ "https://rubygems.org" ];
sha256 = "0i2k5j3l8yy1367hzmg7x3xy984bnmihnzjh0ic8s2nwb3b2h770";
type = "gem";
};
version = "13.0.3";
};
cucumber-cucumber-expressions = {
dependencies = [ "bigdecimal" ];
groups = [ "default" ];
platforms = [ ];
source = {
remotes = [ "https://rubygems.org" ];
sha256 = "14fkk7bfzm9cyacgcyzgkjc3nblflz4rcnlyz0pzd1ypwpqrvgm1";
type = "gem";
};
version = "17.1.0";
};
cucumber-gherkin = {
dependencies = [ "cucumber-messages" ];
groups = [ "default" ];
platforms = [ ];
source = {
remotes = [ "https://rubygems.org" ];
sha256 = "063p0slf6fvigdn3jynp5pjf9b05byyyi0jhsyapy46hq4984sif";
type = "gem";
};
version = "27.0.0";
};
cucumber-html-formatter = {
dependencies = [ "cucumber-messages" ];
groups = [ "default" ];
platforms = [ ];
source = {
remotes = [ "https://rubygems.org" ];
sha256 = "18bfg6gpijjbka0pp7604src1ajjkmsr79nyvr6zjgw4j0nvdsfn";
type = "gem";
};
version = "21.9.0";
};
cucumber-messages = {
groups = [ "default" ];
platforms = [ ];
source = {
remotes = [ "https://rubygems.org" ];
sha256 = "06d7dnixz68ivngf6qflmi6xrjshjyi85gmyjrl07pbmhqi6r2nh";
type = "gem";
};
version = "22.0.0";
};
cucumber-tag-expressions = {
groups = [ "default" ];
platforms = [ ];
source = {
remotes = [ "https://rubygems.org" ];
sha256 = "0vcifp1fiha6yqi36m26n1vr8sz3dpnn5966hcz4a3dq43lf947p";
type = "gem";
};
version = "6.1.2";
};
diff-lcs = {
groups = [ "default" ];
platforms = [ ];
source = {
remotes = [ "https://rubygems.org" ];
sha256 = "0qlrj2qyysc9avzlr4zs1py3x684hqm61n4czrsk1pyllz5x5q4s";
type = "gem";
};
version = "1.6.2";
};
ffi = {
groups = [ "default" ];
platforms = [ ];
source = {
remotes = [ "https://rubygems.org" ];
sha256 = "19kdyjg3kv7x0ad4xsd4swy5izsbb1vl1rpb6qqcqisr5s23awi9";
type = "gem";
};
version = "1.17.2";
};
mini_mime = {
groups = [ "default" ];
platforms = [ ];
source = {
remotes = [ "https://rubygems.org" ];
sha256 = "1vycif7pjzkr29mfk4dlqv3disc5dn0va04lkwajlpr1wkibg0c6";
type = "gem";
};
version = "1.1.5";
};
multi_test = {
groups = [ "default" ];
platforms = [ ];
source = {
remotes = [ "https://rubygems.org" ];
sha256 = "042d6a1416h3di57z107ygmjdgacrpyswi73ryz75yv3v36m1rg9";
type = "gem";
};
version = "1.1.0";
};
sys-uname = {
dependencies = [ "ffi" ];
groups = [ "default" ];
platforms = [ ];
source = {
remotes = [ "https://rubygems.org" ];
sha256 = "177l8rrqnb4rxf657mw28sgvgc8a2m7nlqcbdbra5m4xga0ypcxp";
type = "gem";
};
version = "1.3.1";
};
}

View File

@@ -0,0 +1,27 @@
{
lib,
bundlerApp,
bundlerUpdateScript,
}:
bundlerApp {
pname = "cucumber";
gemdir = ./.;
exes = [ "cucumber" ];
passthru.updateScript = bundlerUpdateScript "cucumber";
meta = with lib; {
description = "Tool for executable specifications";
homepage = "https://cucumber.io/";
changelog = "https://github.com/cucumber/cucumber-ruby/blob/main/CHANGELOG.md";
license = licenses.mit;
mainProgram = "cucumber";
maintainers = with maintainers; [
manveru
nicknovitski
anthonyroussel
];
platforms = platforms.unix;
};
}

View File

@@ -0,0 +1,14 @@
diff --git a/Makefile.am b/Makefile.am
index 45f216a..39c3c82 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -3,6 +3,9 @@ ACLOCAL_AMFLAGS = -I m4
include_HEADERS = cudd/cudd.h
if DDDMP
include_HEADERS += dddmp/dddmp.h
+include_HEADERS += util/util.h
+include_HEADERS += config.h
+include_HEADERS += mtr/mtr.h
endif
if OBJ
include_HEADERS += cplusplus/cuddObj.hh

View File

@@ -0,0 +1,35 @@
{
lib,
stdenv,
fetchurl,
autoreconfHook,
}:
stdenv.mkDerivation {
pname = "cudd";
version = "3.0.0";
src = fetchurl {
url = "https://davidkebo.com/source/cudd_versions/cudd-3.0.0.tar.gz";
sha256 = "0sgbgv7ljfr0lwwwrb9wsnav7mw7jmr3k8mygwza15icass6dsdq";
};
configureFlags = [
"--enable-dddmp"
"--enable-obj"
];
patches = [
./cudd.patch
];
nativeBuildInputs = [ autoreconfHook ];
meta = with lib; {
homepage = "https://davidkebo.com/cudd";
description = "Binary Decision Diagram (BDD) library";
license = licenses.bsd3;
platforms = platforms.all;
maintainers = with maintainers; [ chessai ];
};
}

View File

@@ -0,0 +1,60 @@
{
buildGoModule,
fetchFromGitHub,
lib,
stdenv,
installShellFiles,
testers,
callPackage,
}:
buildGoModule (finalAttrs: {
pname = "cue";
version = "0.14.1";
src = fetchFromGitHub {
owner = "cue-lang";
repo = "cue";
tag = "v${finalAttrs.version}";
hash = "sha256-U/Cptda+2UIDIxuStNYAwZABlNdkS723TnoixVlvS4k=";
};
vendorHash = "sha256-hV5LO9R854YuazzS6VkxoY64h3+JboBgEDRWAoWats8=";
subPackages = [ "cmd/*" ];
nativeBuildInputs = [ installShellFiles ];
ldflags = [
"-s"
"-w"
"-X cuelang.org/go/cmd/cue/cmd.version=v${finalAttrs.version}"
];
postInstall = lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) ''
installShellCompletion --cmd cue \
--bash <($out/bin/cue completion bash) \
--fish <($out/bin/cue completion fish) \
--zsh <($out/bin/cue completion zsh)
'';
passthru = {
writeCueValidator = callPackage ./validator.nix { };
tests = {
test-001-all-good = callPackage ./tests/001-all-good.nix { };
version = testers.testVersion {
package = finalAttrs.finalPackage;
command = "cue version";
version = "v${finalAttrs.version}";
};
};
};
meta = {
description = "Data constraint language which aims to simplify tasks involving defining and using data";
homepage = "https://cuelang.org/";
license = lib.licenses.asl20;
maintainers = with lib.maintainers; [ aaronjheng ];
mainProgram = "cue";
};
})

View File

@@ -0,0 +1,13 @@
{
cue,
runCommand,
}:
runCommand "cue-test-001-all-good-${cue.version}"
{
nativeBuildInputs = [ cue ];
meta.timeout = 10;
}
''
cue eval - <<<'a: "all good"' > $out
''

View File

@@ -0,0 +1,23 @@
{
cue,
writeShellScript,
lib,
}:
# `document` must be a fragment of definition or structure that the input data will be matched against.
# `document` must exist in the Cue schema file provided (`cueSchemaFile`).
# The result is a script that can be used to validate the input data (JSON/YAML and more can be supported depending on Cue)
# against the fragment described by `document` or the whole definition.
# The script will be strict and enforce concrete values, i.e. partial documents are not supported.
cueSchemaFile:
{
document ? null,
}:
writeShellScript "validate-using-cue" ''
${cue}/bin/cue \
--all-errors \
vet \
--concrete \
"$1" \
${cueSchemaFile} \
${lib.optionalString (document != null) "-d \"${document}\""}
''

View File

@@ -0,0 +1,37 @@
{
lib,
stdenv,
fetchFromGitHub,
}:
stdenv.mkDerivation {
pname = "cue2pops";
version = "0-unstable-2023-01-15";
src = fetchFromGitHub {
owner = "makefu";
repo = "cue2pops-linux";
rev = "3f2be6126bd50dfe6b998bc8926f88ce9139c19a";
hash = "sha256-7rgYvqeH8ZDI8Vc5vnjIhe3Ke0TE1q/iFHEqucanhUM=";
};
dontConfigure = true;
installPhase = ''
runHook preInstall
install --directory --mode=755 $out/bin
install --mode=755 cue2pops $out/bin
runHook postInstall
'';
meta = {
description = "Convert CUE to ISO suitable to POPStarter";
homepage = "https://github.com/makefu/cue2pops-linux";
# Upstream license is unclear.
# <https://github.com/ErikAndren/cue2pops-mac/issues/2#issuecomment-673983298>
license = lib.licenses.unfree;
maintainers = [ ];
platforms = lib.platforms.all;
mainProgram = "cue2pops";
};
}

View File

@@ -0,0 +1,33 @@
{
lib,
buildGoModule,
fetchFromGitHub,
}:
buildGoModule rec {
pname = "cuelsp";
version = "0.3.4";
src = fetchFromGitHub {
owner = "dagger";
repo = "cuelsp";
rev = "v${version}";
sha256 = "sha256-+E49TR2D26HSTwgwO1XFkIwXr5lmvv9l3KtR8dVT/cQ=";
};
vendorHash = "sha256-zg4aXPY2InY5VEX1GLJkGhMlfa5EezObAjIuX/bGvlc=";
doCheck = false;
subPackages = [
"cmd/cuelsp"
];
meta = with lib; {
description = "Language Server implementation for CUE, with built-in support for Dagger";
mainProgram = "cuelsp";
homepage = "https://github.com/dagger/cuelsp";
license = licenses.asl20;
maintainers = with maintainers; [ sagikazarmark ];
};
}

View File

@@ -0,0 +1,49 @@
{
lib,
stdenv,
fetchFromGitHub,
autoreconfHook,
bison,
flac,
flex,
id3v2,
vorbis-tools,
}:
stdenv.mkDerivation rec {
pname = "cuetools";
version = "1.4.1";
src = fetchFromGitHub {
owner = "svend";
repo = "cuetools";
rev = version;
sha256 = "02ksv1ahf1v4cr2xbclsfv5x17m9ivzbssb5r8xjm97yh8a7spa3";
};
nativeBuildInputs = [ autoreconfHook ];
buildInputs = [
bison
flac
flex
id3v2
vorbis-tools
];
postInstall = ''
# add link for compatibility with Debian-based distros, which package `cuetag.sh` as `cuetag`
ln -s $out/bin/cuetag.sh $out/bin/cuetag
'';
meta = with lib; {
description = "Set of utilities for working with cue files and toc files";
homepage = "https://github.com/svend/cuetools";
license = licenses.gpl2Only;
maintainers = with maintainers; [
codyopel
jcumming
];
platforms = platforms.all;
};
}

View File

@@ -0,0 +1,27 @@
{
buildGoModule,
fetchFromGitHub,
lib,
}:
buildGoModule rec {
pname = "cuetsy";
version = "0.1.11";
src = fetchFromGitHub {
owner = "grafana";
repo = "cuetsy";
rev = "v${version}";
hash = "sha256-dirzVR4j5K1+EHbeRi4rHwRxkyveySoM7qJzvOlGp+0=";
};
vendorHash = "sha256-CDa7ZfbVQOIt24VZTy4j0Dn24nolmYa0h9zgrJ3QTeY=";
meta = {
description = "Experimental CUE->TypeScript exporter";
homepage = "https://github.com/grafana/cuetsy";
license = lib.licenses.asl20;
maintainers = with lib.maintainers; [ bryanhonof ];
mainProgram = "cuetsy";
};
}

View File

@@ -0,0 +1,38 @@
{
lib,
stdenvNoCC,
fetchurl,
}:
stdenvNoCC.mkDerivation rec {
pname = "culmus";
version = "0.133";
src = fetchurl {
url = "mirror://sourceforge/${pname}/${pname}/${version}/${pname}-${version}.tar.gz";
hash = "sha256-wMaHN0LQdUT2us8q1S65yzkpdNVkJ5ONwd+8g5nGTQU=";
};
installPhase = ''
runHook preInstall
mkdir -p $out/share/fonts/{truetype,type1}
cp -v *.pfa $out/share/fonts/type1/
cp -v *.afm $out/share/fonts/type1/
cp -v fonts.scale-type1 $out/share/fonts/type1/fonts.scale
cp -v *.ttf $out/share/fonts/truetype/
cp -v *.otf $out/share/fonts/truetype/
cp -v fonts.scale-ttf $out/share/fonts/truetype/fonts.scale
runHook postInstall
'';
meta = {
description = "Culmus Hebrew fonts";
longDescription = "The Culmus project aims at providing the Hebrew-speaking GNU/Linux and Unix community with a basic collection of Hebrew fonts for X Windows.";
platforms = lib.platforms.all;
license = lib.licenses.gpl2;
homepage = "http://culmus.sourceforge.net/";
downloadPage = "http://culmus.sourceforge.net/download.html";
};
}

View File

@@ -0,0 +1,45 @@
{
stdenv,
lib,
fetchFromGitHub,
meson,
ninja,
pkg-config,
dtc,
}:
stdenv.mkDerivation {
pname = "culvert";
version = "0.4.0.unstable-2024-10-17";
src = fetchFromGitHub {
owner = "amboar";
repo = "culvert";
rev = "770a6ed4badec1c6e3079cd9b354d0996d55b326";
hash = "sha256-Lj72uYItTxTVYcSEbr/XezeyFvrcqqMTu74tOE+DwJE=";
};
nativeBuildInputs = [
meson
ninja
pkg-config
dtc # The dtc binary to compile device trees
];
buildInputs = [
dtc # provides libfdt
];
mesonFlags = [
"-Db_lto=false"
];
meta = with lib; {
homepage = "https://github.com/amboar/culvert";
description = "Test and Debug Tool for BMC AHB Interfaces ";
mainProgram = "culvert";
license = licenses.asl20;
maintainers = [ maintainers.baloo ];
platforms = platforms.linux;
};
}

View File

@@ -0,0 +1,49 @@
{
lib,
python3Packages,
fetchPypi,
}:
python3Packages.buildPythonApplication rec {
pname = "cum";
version = "0.9.1";
format = "pyproject";
src = fetchPypi {
inherit pname version;
sha256 = "15qc6agka2g3kcnpnz0hbjic1s3260cr9bda0rlcyninxs1vndq0";
};
build-system = with python3Packages; [
setuptools
];
dependencies = with python3Packages; [
alembic
beautifulsoup4
click
natsort
requests
sqlalchemy
];
# tests seem to fail for `config` not being defined,
# but it works once installed
doCheck = false;
# remove the top-level `tests` and `LICENSE` file
# they should not be installed, and there can be issues if another package
# has a collision (especially with the license file)
postInstall = ''
rm -rf $out/tests $out/LICENSE
'';
meta = with lib; {
description = "Comic updater, mangafied";
mainProgram = "cum";
homepage = "https://github.com/Hamuko/cum";
license = licenses.asl20;
maintainers = [ ];
platforms = platforms.all;
};
}

View File

@@ -0,0 +1,170 @@
diff --git a/cuneiform_src/Kern/ctb/src/ctb_oper.c b/cuneiform_src/Kern/ctb/src/ctb_oper.c
index 2aedd58..3d7ec65 100644
--- a/cuneiform_src/Kern/ctb/src/ctb_oper.c
+++ b/cuneiform_src/Kern/ctb/src/ctb_oper.c
@@ -61,6 +61,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#define MAXPATH 256
#include<string.h>
#include<sys/stat.h>
+#include<ctype.h>
#include "ctb.h"
/// extern fuxntions and data
diff --git a/cuneiform_src/Kern/dif/src/diffr.c b/cuneiform_src/Kern/dif/src/diffr.c
index f0d89db..7d0d898 100644
--- a/cuneiform_src/Kern/dif/src/diffr.c
+++ b/cuneiform_src/Kern/dif/src/diffr.c
@@ -105,7 +105,7 @@ extern uchar BUFFER[256]; /*
extern uchar LOCAL[50]; /* <20><><EFBFBD><EFBFBD><E0A4A8><EFBFBD><EFBFBD> <20><><EFBFBD> */
extern uchar LOCAL_W[50]; /* <20><><EFBFBD> <20><><EFBFBD> */
extern uchar end1,beg2; /* <20><><EFBFBD><EFBFBD><EFBFBD> 1 <20> <20><><EFBFBD> 2-<2D><> <20><><EFBFBD> <20><><EFBFBD> */
-extern broken_ii; /* 䫠<> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> */
+extern uchar broken_ii; /* 䫠<> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> */
extern int16_t dnri_hook; // bottom right hook in small russian italic II,III
extern int16_t uple_hook; // bottom left hook in small russian italic II,III
extern int16_t up_jack ; // upper jack
diff --git a/cuneiform_src/Kern/hdebug/__snp.c b/cuneiform_src/Kern/hdebug/__snp.c
index cbf3353..8682cb1 100644
--- a/cuneiform_src/Kern/hdebug/__snp.c
+++ b/cuneiform_src/Kern/hdebug/__snp.c
@@ -986,11 +986,11 @@ extern "C" {
void SnpDrawLine(Point16* start, Point16* end, int32_t skew,
uint32_t rgb_color, int16_t pen_width, Handle key )
{
- LDPUMA_DrawLine(NULL,start,end,skew,rgb_color,pen_width,key );
+ LDPUMA_DrawLine(NULL,start,end,skew,rgb_color,pen_width,(long int)key );
};
void SnpHideLines(Handle key)
{
- LDPUMA_DeleteLines(NULL,key);
+ LDPUMA_DeleteLines(NULL,(long int)key);
};
void SnpUpdateViews(void)
{
diff --git a/cuneiform_src/Kern/leo/src/leo_dll.c b/cuneiform_src/Kern/leo/src/leo_dll.c
index da09092..25bc167 100644
--- a/cuneiform_src/Kern/leo/src/leo_dll.c
+++ b/cuneiform_src/Kern/leo/src/leo_dll.c
@@ -60,6 +60,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include <ctype.h>
/*#include <io.h>*/
+#include "cfcompat.h"
#include "leo_tune.h"
#include "cpu.h"
#define PC_TYPE 0
diff --git a/cuneiform_src/Kern/loc/src/loc.c b/cuneiform_src/Kern/loc/src/loc.c
index e416b33..4b817ad 100644
--- a/cuneiform_src/Kern/loc/src/loc.c
+++ b/cuneiform_src/Kern/loc/src/loc.c
@@ -63,6 +63,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include <unistd.h>
#endif
#include "loc.h"
+#include "cfcompat.h"
#include "struct.h"
#include <sys/stat.h>
diff --git a/cuneiform_src/Kern/rbal/src/linbam.c b/cuneiform_src/Kern/rbal/src/linbam.c
index cd34fab..a0a93d6 100644
--- a/cuneiform_src/Kern/rbal/src/linbam.c
+++ b/cuneiform_src/Kern/rbal/src/linbam.c
@@ -65,7 +65,7 @@
#include "lang_def.h" // 08.09.2000 E.P.
#include "minmax.h"
-extern line_BL;
+extern Bool line_BL;
extern CSTR_line lin_str;
static void set_basint(void);
diff --git a/cuneiform_src/Kern/rblock/sources/c/ltmain.c b/cuneiform_src/Kern/rblock/sources/c/ltmain.c
index 0653b6b..1c99b28 100644
--- a/cuneiform_src/Kern/rblock/sources/c/ltmain.c
+++ b/cuneiform_src/Kern/rblock/sources/c/ltmain.c
@@ -583,7 +583,7 @@ void PageStrings2 (void)
void LayoutPart1 (void)
{
-extern SheetsCorrectRoots();
+// extern SheetsCorrectRoots();
# ifdef LT_DEBUG
switch (layout)
{
diff --git a/cuneiform_src/Kern/rblock/sources/c/ltroots.c b/cuneiform_src/Kern/rblock/sources/c/ltroots.c
index e68abd5..7efee82 100644
--- a/cuneiform_src/Kern/rblock/sources/c/ltroots.c
+++ b/cuneiform_src/Kern/rblock/sources/c/ltroots.c
@@ -69,6 +69,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
# include <fcntl.h>
# include <stdio.h>
+# include <unistd.h>
/*# include <crtdbg.h>*/
#include <assert.h>
@@ -126,7 +127,7 @@ Bool RootsLoadFile (char * pFilename)
return (FALSE);
}
- while (read (hFile, &RootRecord, sizeof (ROOT)) == sizeof (ROOT))
+ while (read ((int)hFile, &RootRecord, sizeof (ROOT)) == sizeof (ROOT))
{
RootRecord.bReached = FALSE;
@@ -143,14 +144,14 @@ Bool RootsLoadFile (char * pFilename)
{
ErrorNoEnoughMemory ("in LTROOTS.C,RootsLoadFile,part 1");
nRoots = 0;
- close (hFile);
+ close ((int)hFile);
return (FALSE);
}
pRoots [nRoots - 1] = RootRecord;
}
- close (hFile);
+ close ((int)hFile);
return (TRUE);
}
# endif
diff --git a/cuneiform_src/Kern/rstr/src/diffr.c b/cuneiform_src/Kern/rstr/src/diffr.c
index 3427806..c4ad6aa 100644
--- a/cuneiform_src/Kern/rstr/src/diffr.c
+++ b/cuneiform_src/Kern/rstr/src/diffr.c
@@ -168,7 +168,7 @@ extern uchar BUFFER[256]; /*
extern uchar LOCAL[50]; /* <20><><EFBFBD><EFBFBD><E0A4A8><EFBFBD><EFBFBD> <20><><EFBFBD> */
extern uchar LOCAL_W[50]; /* <20><><EFBFBD> <20><><EFBFBD> */
extern uchar end1,beg2; /* <20><><EFBFBD><EFBFBD><EFBFBD> 1 <20> <20><><EFBFBD> 2-<2D><> <20><><EFBFBD> <20><><EFBFBD> */
-extern broken_ii; /* 䫠<> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> */
+extern uchar broken_ii; /* 䫠<> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> */
extern int16_t dnri_hook; // bottom right hook in small russian italic II,III
extern int16_t uple_hook; // bottom left hook in small russian italic II,III
extern int16_t up_jack ; // upper jack
diff --git a/cuneiform_src/Kern/rstr/src/match_wd.c b/cuneiform_src/Kern/rstr/src/match_wd.c
index 7a8c7f5..ca5f933 100644
--- a/cuneiform_src/Kern/rstr/src/match_wd.c
+++ b/cuneiform_src/Kern/rstr/src/match_wd.c
@@ -341,7 +341,7 @@ param.monitors=*((uint32_t*)points);
param.p2_active=1; //call while p2 pass
param.language=3; // LANG_RUSSIAN
-if((rc=setjmp(Control_Point())) != 0)
+if((rc=setjmp(*Control_Point())) != 0)
return FALSE;
w=match_string(ln, word, &param);
diff --git a/cuneiform_src/Kern/rstr/src/rcm.c b/cuneiform_src/Kern/rstr/src/rcm.c
index 0659b69..45cf362 100644
--- a/cuneiform_src/Kern/rstr/src/rcm.c
+++ b/cuneiform_src/Kern/rstr/src/rcm.c
@@ -2648,7 +2648,7 @@ int16_t text_findstat_agressive(char * w) {
}
jmp_buf * Control_Point() {
- return jumper;
+ return &jumper;
}
/////////////

View File

@@ -0,0 +1,70 @@
{
lib,
stdenv,
fetchurl,
cmake,
imagemagick,
testers,
}:
# Deprecated: unmaintained, no consumers in nixpkgs as of 2025-10-05, and doesn't compile with gcc 15.
stdenv.mkDerivation (finalAttrs: {
pname = "cuneiform";
version = "1.1.0";
src = fetchurl {
url = "https://launchpad.net/cuneiform-linux/1.1/1.1/+download/cuneiform-linux-1.1.0.tar.bz2";
sha256 = "1bdvppyfx2184zmzcylskd87cxv56d8f32jf7g1qc8779l2hszjp";
};
patches = [
(fetchurl {
url = "https://raw.githubusercontent.com/archlinux/svntogit-community/a2ec92f05de006b56d16ac6a6c370d54a554861a/cuneiform/trunk/build-fix.patch";
sha256 = "19cmrlx4khn30qqrpyayn7bicg8yi0wpz1x1bvqqrbvr3kwldxyj";
})
(fetchurl {
url = "https://gitweb.gentoo.org/repo/gentoo.git/plain/app-text/cuneiform/files/cuneiform-1.1.0-gcc11.patch?id=fd8e596c6a5eab634656e265c3da5241f5ceee8c";
sha256 = "14bp2f4dvlgxnpdza1rgszhkbxhp6p7lhgnb1s7c1x7vwdrx0ri7";
})
./gcc14-fix.patch
];
# Workaround build failure on -fno-common toolchains like upstream
# gcc-10. Otherwise build fails as:
# ld: CMakeFiles/rbal.dir/src/statsearchbl.cpp.o:(.bss+0x0):
# multiple definition of `minrow'; CMakeFiles/rbal.dir/src/linban.c.o:(.bss+0xa3a): first defined here
env.NIX_CFLAGS_COMPILE = "-fcommon";
postPatch = ''
rm cuneiform_src/Kern/hhh/tigerh/h/strings.h
substituteInPlace CMakeLists.txt --replace-fail \
'cmake_minimum_required(VERSION 2.6.2)' \
'cmake_minimum_required(VERSION 3.10)'
'';
# make the install path match the rpath
postInstall = ''
if [[ -d ''${!outputLib}/lib64 ]]; then
mv ''${!outputLib}/lib64 ''${!outputLib}/lib
ln -s lib ''${!outputLib}/lib64
fi
'';
buildInputs = [ imagemagick ];
nativeBuildInputs = [ cmake ];
passthru.tests = testers.testVersion {
package = finalAttrs.finalPackage;
command = "cuneiform";
};
meta = with lib; {
description = "Multi-language OCR system";
homepage = "https://launchpad.net/cuneiform-linux";
license = licenses.bsd3;
platforms = platforms.linux;
maintainers = [ maintainers.raskin ];
mainProgram = "cuneiform";
};
})

View File

@@ -0,0 +1,78 @@
{
lib,
stdenv,
buildGoModule,
fetchFromGitHub,
installShellFiles,
versionCheckHook,
protobuf,
protoc-gen-go,
protoc-gen-go-grpc,
nix-update-script,
}:
buildGoModule rec {
pname = "cunicu";
version = "0.12.0";
src = fetchFromGitHub {
owner = "cunicu";
repo = "cunicu";
rev = "v${version}";
hash = "sha256-1y9olRSPu2akvE728oXBr70Pt03xj65R2GaOlZ/7RTg=";
};
vendorHash = "sha256-yFpkYI6ue5LXwRCj4EqWDBaO3TYzZ3Ov/39PRQWMWzk=";
nativeBuildInputs = [
installShellFiles
protobuf
protoc-gen-go
protoc-gen-go-grpc
];
nativeInstallCheckInputs = [
versionCheckHook
];
env.CGO_ENABLED = 0;
# These packages contain networking dependent tests which fail in the sandbox
excludedPackages = [
"pkg/config"
"pkg/selfupdate"
"pkg/tty"
"scripts"
];
ldflags = [
"-X cunicu.li/cunicu/pkg/buildinfo.Version=${version}"
"-X cunicu.li/cunicu/pkg/buildinfo.BuiltBy=Nix"
];
doInstallCheck = true;
versionCheckProgramArg = "version";
passthru.updateScript = nix-update-script { };
preBuild = ''
go generate ./...
'';
postInstall = lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) ''
$out/bin/cunicu docs --with-frontmatter
installManPage ./docs/usage/man/*.1
installShellCompletion --cmd cunicu \
--bash <($out/bin/cunicu completion bash) \
--zsh <($out/bin/cunicu completion zsh) \
--fish <($out/bin/cunicu completion fish)
'';
meta = {
description = "Zeroconf peer-to-peer mesh VPN using Wireguard® and Interactive Connectivity Establishment (ICE)";
homepage = "https://cunicu.li";
license = lib.licenses.asl20;
maintainers = with lib.maintainers; [ stv0g ];
platforms = lib.platforms.linux;
mainProgram = "cunicu";
};
}

View File

@@ -0,0 +1,41 @@
{
lib,
stdenv,
fetchurl,
autoconf,
automake,
libtool,
autoreconfHook,
}:
stdenv.mkDerivation rec {
pname = "CUnit";
version = "2.1-3";
nativeBuildInputs = [
autoreconfHook
autoconf
automake
];
buildInputs = [ libtool ];
src = fetchurl {
url = "mirror://sourceforge/cunit/CUnit/${version}/CUnit-${version}.tar.bz2";
sha256 = "057j82da9vv4li4z5ri3227ybd18nzyq81f6gsvhifs5z0vr3cpm";
};
meta = {
description = "Unit Testing Framework for C";
longDescription = ''
CUnit is a lightweight system for writing, administering, and running
unit tests in C. It provides C programmers a basic testing functionality
with a flexible variety of user interfaces.
'';
homepage = "https://cunit.sourceforge.net/";
license = lib.licenses.lgpl2;
platforms = lib.platforms.unix;
};
}

View File

@@ -0,0 +1,97 @@
{
rustPlatform,
fetchFromGitHub,
lib,
stdenvNoCC,
bun,
nodejs-slim_latest,
nix-update-script,
withServer ? true,
}:
let
pname = "cup-docker";
version = "3.4.2";
src = fetchFromGitHub {
owner = "sergi0g";
repo = "cup";
tag = "v${version}";
hash = "sha256-gKKSrd58F8pe/fy29gLY/4ugfhVXI0yyUnIarIMF/L8=";
};
web = stdenvNoCC.mkDerivation (finalAttrs: {
pname = "${pname}-web";
inherit version src;
impureEnvVars = lib.fetchers.proxyImpureEnvVars ++ [
"GIT_PROXY_COMMAND"
"SOCKS_SERVER"
];
sourceRoot = "${finalAttrs.src.name}/web";
nativeBuildInputs = [
bun
nodejs-slim_latest
];
configurePhase = ''
runHook preConfigure
bun install --no-progress --frozen-lockfile
substituteInPlace node_modules/.bin/{vite,tsc} \
--replace-fail "/usr/bin/env node" "${nodejs-slim_latest}/bin/node"
runHook postConfigure
'';
buildPhase = ''
runHook preBuild
bun run build
runHook postBuild
'';
installPhase = ''
runHook preInstall
mkdir -p $out/dist
cp -R ./dist $out
runHook postInstall
'';
outputHash = "sha256-Ac1PJYmTQv9XrmhmF1p77vdXh8252hz0CUKxJA+VQR4=";
outputHashAlgo = "sha256";
outputHashMode = "recursive";
});
in
rustPlatform.buildRustPackage {
inherit
src
version
pname
;
cargoHash = "sha256-1VSbv6lDRRLZIu7hYrAqzQmvxcuhnPU0rcWfg7Upcm4=";
buildNoDefaultFeatures = true;
buildFeatures = [
"cli"
]
++ lib.optional withServer [
"server"
];
preConfigure = lib.optionalString withServer ''
cp -r ${web}/dist src/static
'';
passthru = {
inherit web;
updateScript = nix-update-script {
extraArgs = [
"--subpackage"
"web"
];
};
};
meta = {
description = "Lightweight way to check for container image updates. written in Rust";
homepage = "https://cup.sergi0g.dev";
license = lib.licenses.agpl3Only;
platforms = lib.platforms.all;
changelog = "https://github.com/sergi0g/cup/releases";
mainProgram = "cup";
maintainers = with lib.maintainers; [
kuflierl
];
};
}

View File

@@ -0,0 +1,43 @@
{
lib,
stdenv,
fetchurl,
cups,
}:
stdenv.mkDerivation (finalAttrs: {
pname = "cups-bjnp";
version = "2.0.3";
src = fetchurl {
url = "mirror://sourceforge/cups-bjnp/cups-bjnp-${finalAttrs.version}.tar.gz";
hash = "sha256-yRSy/Z2OJs4i8t9iRNne/uwx7ppTYPcj7ss7APIWhQA=";
};
preConfigure = ''
mkdir -p $out/lib/cups/backend
configureFlags="--with-cupsbackenddir=$out/lib/cups/backend"
'';
buildInputs = [ cups ];
env.NIX_CFLAGS_COMPILE = toString [
"-include stdio.h"
"-Wno-error=stringop-truncation"
"-Wno-error=deprecated-declarations"
"-Wno-unused-variable"
"-Wno-error=address"
"-Wno-error=dangling-pointer"
];
meta = {
description = "CUPS back-end for Canon printers";
longDescription = ''
CUPS back-end for the canon printers using the proprietary USB over IP
BJNP protocol. This back-end allows Cups to print over the network to a
Canon printer. The design is based on reverse engineering of the protocol.
'';
homepage = "http://cups-bjnp.sourceforge.net";
platforms = lib.platforms.linux;
};
})

View File

@@ -0,0 +1,122 @@
{
lib,
stdenvNoCC,
pkgsi686Linux,
fetchurl,
cups,
dpkg,
gnused,
makeWrapper,
ghostscript,
file,
a2ps,
coreutils,
gawk,
}:
let
version = "3.0.1-1";
cupsdeb = fetchurl {
url = "https://download.brother.com/welcome/dlf101532/dcp1610wcupswrapper-${version}.i386.deb";
hash = "sha256-ZgE2o/xU11+MzSnBYakXZE5m+Qa85/KIo31wKWAmsGY=";
};
lprdeb = fetchurl {
url = "https://download.brother.com/welcome/dlf101533/dcp1610wlpr-${version}.i386.deb";
hash = "sha256-hi0b23DgSXVT/fNA+Y2aJOdopt7SwjUyYyev81boGlg=";
};
in
stdenvNoCC.mkDerivation {
pname = "cups-brother-dcp1610wlpr";
inherit version;
srcs = [
cupsdeb
lprdeb
];
nativeBuildInputs = [
makeWrapper
];
buildInputs = [
cups
ghostscript
dpkg
a2ps
];
unpackPhase = ''
runHook preUnpack
dpkg-deb -x ${lprdeb} $out
dpkg-deb -x ${cupsdeb} $out
runHook postUnpack
'';
installPhase = ''
runHook preInstall
mkdir -p $out/lib/cups/filter $out/share/cups/model
ln -s $out/opt/brother/Printers/DCP1610W/cupswrapper/brother_lpdwrapper_DCP1610W $out/lib/cups/filter/brother_lpdwrapper_DCP1610W
ln -s $out/opt/brother/Printers/DCP1610W/cupswrapper/brother-DCP1610W-cups-en.ppd $out/share/cups/model/
ln -s $out/opt/brother/Printers/DCP1610W/cupswrapper/brcupsconfig4 $out/lib/cups/filter/brcupsconfig4
runHook postInstall
'';
postFixup = ''
substituteInPlace $out/opt/brother/Printers/DCP1610W/lpd/filter_DCP1610W \
--replace-fail /opt "$out/opt"
sed -i '/GHOST_SCRIPT=/c\GHOST_SCRIPT=gs' $out/opt/brother/Printers/DCP1610W/lpd/psconvert2
patchelf --set-interpreter ${pkgsi686Linux.glibc.out}/lib/ld-linux.so.2 $out/opt/brother/Printers/DCP1610W/lpd/brprintconflsr3
patchelf --set-interpreter ${pkgsi686Linux.glibc.out}/lib/ld-linux.so.2 $out/opt/brother/Printers/DCP1610W/lpd/rawtobr3
patchelf --set-interpreter ${pkgsi686Linux.glibc.out}/lib/ld-linux.so.2 $out/opt/brother/Printers/DCP1610W/inf/braddprinter
wrapProgram $out/opt/brother/Printers/DCP1610W/lpd/psconvert2 \
--prefix PATH ":" ${
lib.makeBinPath [
gnused
coreutils
gawk
]
}
wrapProgram $out/opt/brother/Printers/DCP1610W/lpd/filter_DCP1610W \
--prefix PATH ":" ${
lib.makeBinPath [
ghostscript
a2ps
file
gnused
coreutils
]
}
substituteInPlace $out/opt/brother/Printers/DCP1610W/cupswrapper/brother_lpdwrapper_DCP1610W \
--replace-fail /opt "$out/opt"
wrapProgram $out/opt/brother/Printers/DCP1610W/cupswrapper/brother_lpdwrapper_DCP1610W \
--prefix PATH ":" ${
lib.makeBinPath [
gnused
coreutils
gawk
]
}
'';
meta = {
homepage = "http://www.brother.com/";
description = "Brother DCP-1610W printer driver";
sourceProvenance = with lib.sourceTypes; [ binaryNativeCode ];
license = lib.licenses.unfreeRedistributable;
platforms = [
"x86_64-linux"
"i686-linux"
];
downloadPage = "https://support.brother.com/g/b/downloadlist.aspx?c=nz&lang=en&prod=dcp1610w_eu_as&os=128";
};
}

View File

@@ -0,0 +1,109 @@
{
pkgsi686Linux,
lib,
stdenv,
fetchurl,
dpkg,
makeWrapper,
ghostscript,
file,
gnused,
gnugrep,
coreutils,
which,
perl,
}:
let
version = "1.0.2-0";
model = "dcpl3550cdw";
interpreter = "${pkgsi686Linux.stdenv.cc.libc}/lib/ld-linux.so.2";
in
stdenv.mkDerivation {
pname = "cups-brother-${model}";
inherit version;
src = fetchurl {
url = "https://download.brother.com/welcome/dlf103919/dcpl3550cdwpdrv-${version}.i386.deb";
hash = "sha256-FbtqISK3f1q1+JXJ+RP5O/8G0ZW9gcCS7OI0YRljwyY=";
};
nativeBuildInputs = [
dpkg
makeWrapper
];
unpackPhase = ''
runHook preUnpack
dpkg-deb -x $src $out
runHook postUnpack
'';
installPhase = ''
runHook preInstall
substituteInPlace $out/opt/brother/Printers/${model}/lpd/filter_${model} \
--replace-fail /usr/bin/perl ${lib.getExe perl} \
--replace-fail "PRINTER =~" "PRINTER = \"${model}\"; #" \
--replace-fail "BR_PRT_PATH =~" "BR_PRT_PATH = \"$out/opt/brother/Printers/${model}/\"; #"
substituteInPlace $out/opt/brother/Printers/${model}/cupswrapper/brother_lpdwrapper_${model} \
--replace-fail /usr/bin/perl ${lib.getExe perl} \
--replace-fail "basedir =~ " "basedir = \"$out/opt/brother/Printers/${model}/\"; #" \
--replace-fail "PRINTER =~ " "PRINTER = \"${model}\"; #" \
--replace-fail "LPDCONFIGEXE=" "LPDCONFIGEXE=\"$out/usr/bin/brprintconf_\"; #"
patchelf --set-interpreter ${interpreter} $out/opt/brother/Printers/${model}/lpd/br${model}filter
patchelf --set-interpreter ${interpreter} $out/usr/bin/brprintconf_${model}
mkdir -p $out/lib/cups/filter $out/share/cups/model
ln -s $out/opt/brother/Printers/${model}/lpd/filter_${model} $out/lib/cups/filter/brlpdwrapper${model}
ln -s $out/opt/brother/Printers/${model}/cupswrapper/brother_lpdwrapper_${model} $out/lib/cups/filter/brother_lpdwrapper_${model}
ln -s $out/opt/brother/Printers/${model}/cupswrapper/brother_${model}_printer_en.ppd $out/share/cups/model/brother_${model}_printer_en.ppd
runHook postInstall
'';
postFixup = ''
wrapProgram $out/opt/brother/Printers/${model}/lpd/filter_${model} \
--prefix PATH ":" ${
lib.makeBinPath [
ghostscript
file
gnused
gnugrep
coreutils
which
]
}
wrapProgram $out/opt/brother/Printers/${model}/cupswrapper/brother_lpdwrapper_${model} \
--prefix PATH ":" ${
lib.makeBinPath [
gnugrep
coreutils
]
}
wrapProgram $out/usr/bin/brprintconf_${model} \
--set LD_PRELOAD "${pkgsi686Linux.libredirect}/lib/libredirect.so" \
--set NIX_REDIRECTS /opt=$out/opt
wrapProgram $out/opt/brother/Printers/${model}/lpd/br${model}filter \
--set LD_PRELOAD "${pkgsi686Linux.libredirect}/lib/libredirect.so" \
--set NIX_REDIRECTS /opt=$out/opt
'';
meta = {
homepage = "https://www.brother.com/";
downloadPage = "https://support.brother.com/g/b/downloadlist.aspx?c=eu_ot&lang=en&prod=${model}_eu&os=128";
description = "Brother DCP-L3550CDW printer driver";
license = with lib.licenses; [
unfreeRedistributable
gpl2Only
];
sourceProvenance = with lib.sourceTypes; [ binaryNativeCode ];
platforms = [
"x86_64-linux"
"i686-linux"
];
maintainers = with lib.maintainers; [ Tert0 ];
};
}

View File

@@ -0,0 +1,152 @@
{
stdenv,
stdenvNoCC,
lib,
fetchurl,
perl,
gnused,
dpkg,
makeWrapper,
autoPatchelfHook,
libredirect,
gnugrep,
coreutils,
ghostscript,
file,
pkgsi686Linux,
}:
stdenvNoCC.mkDerivation (finalAttrs: {
pname = "cups-brother-dcpt310";
version = "1.0.1";
src = fetchurl {
url = "https://download.brother.com/welcome/dlf103618/dcpt310pdrv-${finalAttrs.version}-0.i386.deb";
sha256 = "0g9hylmpgmzd6k9lxjy32c7pxbzj6gr9sfaahxj3xzqyar05amdx";
};
nativeBuildInputs = [
dpkg
makeWrapper
autoPatchelfHook
];
buildInputs = [
perl
gnused
libredirect
pkgsi686Linux.stdenv.cc.cc.lib
];
unpackPhase = ''
runHook preUnpack
dpkg-deb -x $src .
runHook postUnpack
'';
installPhase = ''
runHook preInstall
mkdir -p "$out"
cp -pr opt "$out"
cp -pr usr/bin "$out/bin"
rm "$out/opt/brother/Printers/dcpt310/cupswrapper/cupswrapperdcpt310"
mkdir -p "$out/lib/cups/filter" "$out/share/cups/model"
ln -s "../../../opt/brother/Printers/dcpt310/cupswrapper/brother_lpdwrapper_dcpt310" \
"$out/lib/cups/filter/brother_lpdwrapper_dcpt310"
ln -s "../../../opt/brother/Printers/dcpt310/cupswrapper/brother_dcpt310_printer_en.ppd" \
"$out/share/cups/model/brother_dcpt310_printer_en.ppd"
runHook postInstall
'';
# Fix global references and replace auto discovery mechanism
# with hardcoded values.
#
# The configuration binary 'brprintconf_dcpt310' and lpd filter
# 'brdcpt310filter' has hardcoded /opt format strings. There isn't
# sufficient space in the binaries to substitute a path in the store, so use
# libredirect to get it to see the correct path. The configuration binary
# also uses this format string to print configuration locations. Here the
# wrapper output is processed to point into the correct location in the
# store.
postFixup = ''
interpreter=${pkgsi686Linux.glibc.out}/lib/ld-linux.so.2
substituteInPlace $out/opt/brother/Printers/dcpt310/lpd/filter_dcpt310 \
--replace "my \$BR_PRT_PATH =" "my \$BR_PRT_PATH = \"$out/opt/brother/Printers/dcpt310/\"; #" \
--replace /usr/bin/pdf2ps "${ghostscript}/bin/pdf2ps" \
--replace "my \$GHOST_SCRIPT" "my \$GHOST_SCRIPT = \"${ghostscript}/bin/gs\"; #" \
--replace "PRINTER =~" "PRINTER = \"dcpt310\"; #"
substituteInPlace $out/opt/brother/Printers/dcpt310/cupswrapper/brother_lpdwrapper_dcpt310 \
--replace "PRINTER =~" "PRINTER = \"dcpt310\"; #" \
--replace "my \$basedir = \`readlink \$0\`" "my \$basedir = \"$out/opt/brother/Printers/dcpt310/\"" \
--replace "my \$lpdconf = \$LPDCONFIGEXE.\$PRINTER;" "my \$lpdconf = \"$out/bin/brprintconf_dcpt310\";"
patchelf --set-interpreter "$interpreter" "$out/opt/brother/Printers/dcpt310/lpd/brdcpt310filter" \
--set-rpath ${lib.makeLibraryPath [ pkgsi686Linux.stdenv.cc.cc ]}
patchelf --set-interpreter "$interpreter" "$out/bin/brprintconf_dcpt310"
wrapProgram $out/bin/brprintconf_dcpt310 \
--set LD_PRELOAD "${pkgsi686Linux.libredirect}/lib/libredirect.so" \
--set NIX_REDIRECTS /opt=$out/opt
wrapProgram $out/opt/brother/Printers/dcpt310/lpd/brdcpt310filter \
--set PATH ${
lib.makeBinPath [
coreutils
gnugrep
gnused
ghostscript
]
} \
--set LD_PRELOAD "${pkgsi686Linux.libredirect}/lib/libredirect.so" \
--set NIX_REDIRECTS /opt=$out/opt
for f in \
$out/opt/brother/Printers/dcpt310/cupswrapper/brother_lpdwrapper_dcpt310 \
$out/opt/brother/Printers/dcpt310/lpd/filter_dcpt310 \
; do
wrapProgram $f \
--set PATH ${
lib.makeBinPath [
coreutils
ghostscript
gnugrep
gnused
file
]
}
done
substituteInPlace $out/bin/brprintconf_dcpt310 \
--replace \"\$"@"\" \"\$"@\" | LD_PRELOAD= ${gnused}/bin/sed -E '/^(function list :|resource file :).*/{s#/opt#$out/opt#}'"
'';
meta = {
description = "Brother DCP-T310 printer driver";
license = with lib.licenses; [
unfree
gpl2Plus
];
sourceProvenance = with lib.sourceTypes; [
binaryNativeCode
fromSource
];
maintainers = with lib.maintainers; [ inexcode ];
platforms = [
"x86_64-linux"
"i686-linux"
];
homepage = "https://www.brother.com/";
downloadPage = "https://support.brother.com/g/b/downloadhowto.aspx?c=us_ot&lang=en&prod=dcpt310_all&os=128&dlid=dlf103618_000&flang=4&type3=10283";
};
})

View File

@@ -0,0 +1,113 @@
{
stdenv,
lib,
fetchurl,
perl,
ghostscript,
coreutils,
gnugrep,
which,
file,
gnused,
dpkg,
makeWrapper,
libredirect,
debugLvl ? "0",
}:
stdenv.mkDerivation rec {
pname = "cups-brother-dcpt725dw";
version = "3.5.0-1";
src = fetchurl {
url = "https://download.brother.com/welcome/dlf105181/dcpt725dwpdrv-${version}.i386.deb";
hash = "sha256-fK6RHaW/ej1nFgSaTbzWxVgjIW32YTbJbd1xD37ZE7c=";
};
nativeBuildInputs = [
dpkg
makeWrapper
];
buildInputs = [ perl ];
dontUnpack = true;
installPhase = ''
runHook preInstall
mkdir -p $out
dpkg-deb -x $src $out
LPDDIR=$out/opt/brother/Printers/dcpt725dw/lpd
WRAPPER=$out/opt/brother/Printers/dcpt725dw/cupswrapper/brother_lpdwrapper_dcpt725dw
ln -s $LPDDIR/${stdenv.hostPlatform.linuxArch}/* $LPDDIR/
substituteInPlace $WRAPPER \
--replace-fail "PRINTER =~" "PRINTER = \"dcpt725dw\"; #" \
--replace-fail "basedir =~" "basedir = \"$out/opt/brother/Printers/dcpt725dw/\"; #" \
--replace-fail "lpdconf = " "lpdconf = \$lpddir.'/'.\$LPDCONFIGEXE.\$PRINTER; #" \
--replace-fail "\$DEBUG=0;" "\$DEBUG=${debugLvl};"
substituteInPlace $LPDDIR/filter_dcpt725dw \
--replace-fail "BR_PRT_PATH =~" "BR_PRT_PATH = \"$out/opt/brother/Printers/dcpt725dw/\"; #" \
--replace-fail "PRINTER =~" "PRINTER = \"dcpt725dw\"; #"
wrapProgram $WRAPPER \
--prefix PATH : ${
lib.makeBinPath [
coreutils
gnugrep
gnused
]
}
wrapProgram $LPDDIR/filter_dcpt725dw \
--prefix PATH : ${
lib.makeBinPath [
coreutils
ghostscript
gnugrep
gnused
which
file
]
}
patchelf --set-interpreter $(cat $NIX_CC/nix-support/dynamic-linker) \
$LPDDIR/brdcpt725dwfilter
patchelf --set-interpreter $(cat $NIX_CC/nix-support/dynamic-linker) \
$LPDDIR/brprintconf_dcpt725dw
wrapProgram $LPDDIR/brprintconf_dcpt725dw \
--set LD_PRELOAD "${libredirect}/lib/libredirect.so" \
--set NIX_REDIRECTS /opt=$out/opt
wrapProgram $LPDDIR/brdcpt725dwfilter \
--set LD_PRELOAD "${libredirect}/lib/libredirect.so" \
--set NIX_REDIRECTS /opt=$out/opt
mkdir -p "$out/lib/cups/filter" "$out/share/cups/model"
ln -s $out/opt/brother/Printers/dcpt725dw/cupswrapper/brother_lpdwrapper_dcpt725dw \
$out/lib/cups/filter/brother_lpdwrapper_dcpt725dw
ln -s "$out/opt/brother/Printers/dcpt725dw/cupswrapper/brother_dcpt725dw_printer_en.ppd" \
"$out/share/cups/model/"
runHook postInstall
'';
meta = with lib; {
description = "Brother DCP-T725DW printer driver";
license = licenses.unfree;
sourceProvenance = with sourceTypes; [ binaryNativeCode ];
maintainers = with maintainers; [ u2x1 ];
platforms = [
"x86_64-linux"
"i686-linux"
];
downloadPage = "https://support.brother.com/g/b/downloadtop.aspx?c=cn_ot&lang=en&prod=dcpt725dw_cn";
homepage = "http://www.brother.com/";
};
}

View File

@@ -0,0 +1,167 @@
{
lib,
stdenv,
fetchurl,
dpkg,
makeWrapper,
gnused,
coreutils,
psutils,
gnugrep,
ghostscript,
file,
a2ps,
gawk,
which,
pkgsi686Linux,
}:
stdenv.mkDerivation rec {
pname = "cups-brother-${model}";
version = "1.1.4-0";
lprVersion = "1.1.2-1";
model = "hl3170cdw";
cupsFileNo = "006743";
lprFileNo = "007056";
src = fetchurl {
url = "https://download.brother.com/welcome/dlf${cupsFileNo}/${model}_cupswrapper_GPL_source_${version}.tar.gz";
hash = "sha256-E3GSwiMRkuiCIJYkDozoYUPfOqvopPqPPQt1uaMDEAU=";
};
lprdeb = fetchurl {
url = "https://download.brother.com/welcome/dlf${lprFileNo}/${model}lpr-${lprVersion}.i386.deb";
hash = "sha256-N1GjQHth5k4qhbfWLInzub9DcNsee4gKc3EW2WIfrko=";
};
nativeBuildInputs = [
makeWrapper
dpkg
];
preUnpack = ''
dpkg-deb -x ${lprdeb} $out
'';
prePatch = ''
substituteInPlace brcupsconfig/brcups_commands.h \
--replace-fail "brprintconf[30]=\"" "brprintconf[130]=\"$out/usr/bin/"
substituteInPlace brcupsconfig/brcupsconfig.c \
--replace-fail "exec[300]" "exec[400]"
'';
makeFlags = [ "-C brcupsconfig" ];
installPhase = ''
runHook preInstall
# cups install
dir=$out/opt/brother/Printers/${model}
# Extract the true brother_lpdwrapper_MODEL filter embedded in cupswrapperMODEL by
# slicing out the relevant parts for the writing the embedded file, then running that.
sed -n -e '/tmp_filter=/c\tmp_filter=lpdwrapper' -e ' 1,/device_model=/p ; /<<!ENDOFWFILTER/,/!ENDOFWFILTER/p ; ' \
cupswrapper/cupswrapper${model} > lpdwrapperbuilder
sh lpdwrapperbuilder
chmod +x lpdwrapper
mkdir -p $out/lib/cups/filter
cp lpdwrapper $out/lib/cups/filter/brother_lpdwrapper_${model}
mkdir -p $out/share/cups/model/Brother
cp PPD/brother_${model}_printer_en.ppd $out/share/cups/model/Brother/brother_${model}_printer_en.ppd
mkdir -p $dir/cupswrapper/
cp brcupsconfig/brcupsconfpt1 $dir/cupswrapper/
runHook postInstall
'';
preFixup = ''
# lpr fixup
interpreter=${pkgsi686Linux.glibc.out}/lib/ld-linux.so.2
substituteInPlace $dir/lpd/filter${model} \
--replace-fail /opt "$out/opt"
substituteInPlace $dir/inf/setupPrintcapij \
--replace-fail /opt "$out/opt" \
--replace-fail printcap.local printcap
wrapProgram $dir/lpd/filter${model} \
--prefix PATH ":" ${
lib.makeBinPath [
ghostscript
a2ps
file
gnused
coreutils
]
}
wrapProgram $dir/inf/setupPrintcapij \
--prefix PATH ":" ${
lib.makeBinPath [
coreutils
gnused
]
}
wrapProgram $dir/lpd/psconvertij2 \
--prefix PATH ":" ${
lib.makeBinPath [
ghostscript
gnused
coreutils
gawk
which
]
}
patchelf --set-interpreter "$interpreter" "$dir/lpd/br${model}filter"
patchelf --set-interpreter "$interpreter" "$out/usr/bin/brprintconf_${model}"
wrapProgram $dir/lpd/br${model}filter \
--set LD_PRELOAD "${pkgsi686Linux.libredirect}/lib/libredirect.so" \
--set NIX_REDIRECTS "/opt=$out/opt"
wrapProgram $out/usr/bin/brprintconf_${model} \
--set LD_PRELOAD "${pkgsi686Linux.libredirect}/lib/libredirect.so" \
--set NIX_REDIRECTS "/opt=$out/opt"
# cups fixup
substituteInPlace $out/lib/cups/filter/brother_lpdwrapper_${model} \
--replace-fail /opt/brother/Printers/${model} "$dir" \
--replace-fail /usr/bin/psnup "${psutils}/bin/psnup" \
--replace-fail /usr/share/cups/model/Brother "$out/share/cups/model/Brother"
wrapProgram $out/lib/cups/filter/brother_lpdwrapper_${model} \
--prefix PATH ":" ${
lib.makeBinPath [
coreutils
psutils
gnused
gnugrep
]
}
'';
meta = with lib; {
homepage = "https://www.brother.com/";
description = "Brother ${model} printer driver";
sourceProvenance = with sourceTypes; [
binaryNativeCode
fromSource
];
license = with licenses; [
unfree
gpl2Plus
];
platforms = [
"x86_64-linux"
"i686-linux"
];
downloadPage = "https://support.brother.com/g/b/downloadlist.aspx?c=us&lang=en&prod=${model}_all&os=128";
maintainers = with maintainers; [ luna_1024 ];
};
}

View File

@@ -0,0 +1,106 @@
{
lib,
stdenv,
fetchurl,
dpkg,
autoPatchelfHook,
makeWrapper,
perl,
gnused,
ghostscript,
file,
coreutils,
gnugrep,
which,
}:
let
arches = [
"x86_64"
"i686"
"armv7l"
];
runtimeDeps = [
ghostscript
file
gnused
gnugrep
coreutils
which
];
in
stdenv.mkDerivation rec {
pname = "cups-brother-hll2350dw";
version = "4.0.0-1";
nativeBuildInputs = [
dpkg
makeWrapper
autoPatchelfHook
];
buildInputs = [ perl ];
dontUnpack = true;
src = fetchurl {
url = "https://download.brother.com/welcome/dlf103566/hll2350dwpdrv-${version}.i386.deb";
sha256 = "0b7hhln105agc3rwpi7cjlx5nf4d2yk9iksahdv3725nnd06lg46";
};
installPhase = ''
runHook preInstall
mkdir -p $out
dpkg-deb -x $src $out
# delete unnecessary files for the current architecture
''
+ lib.concatMapStrings (arch: ''
echo Deleting files for ${arch}
rm -r "$out/opt/brother/Printers/HLL2350DW/lpd/${arch}"
'') (builtins.filter (arch: arch != stdenv.hostPlatform.linuxArch) arches)
+ ''
# bundled scripts don't understand the arch subdirectories for some reason
ln -s \
"$out/opt/brother/Printers/HLL2350DW/lpd/${stdenv.hostPlatform.linuxArch}/"* \
"$out/opt/brother/Printers/HLL2350DW/lpd/"
# Fix global references and replace auto discovery mechanism with hardcoded values
substituteInPlace $out/opt/brother/Printers/HLL2350DW/lpd/lpdfilter \
--replace /opt "$out/opt" \
--replace "my \$BR_PRT_PATH =" "my \$BR_PRT_PATH = \"$out/opt/brother/Printers/HLL2350DW\"; #" \
--replace "PRINTER =~" "PRINTER = \"HLL2350DW\"; #"
# Make sure all executables have the necessary runtime dependencies available
find "$out" -executable -and -type f | while read file; do
wrapProgram "$file" --prefix PATH : "${lib.makeBinPath runtimeDeps}"
done
# Symlink filter and ppd into a location where CUPS will discover it
mkdir -p $out/lib/cups/filter
mkdir -p $out/share/cups/model
ln -s \
$out/opt/brother/Printers/HLL2350DW/lpd/lpdfilter \
$out/lib/cups/filter/brother_lpdwrapper_HLL2350DW
ln -s \
$out/opt/brother/Printers/HLL2350DW/cupswrapper/brother-HLL2350DW-cups-en.ppd \
$out/share/cups/model/
runHook postInstall
'';
meta = with lib; {
homepage = "http://www.brother.com/";
description = "Brother HL-L2350DW printer driver";
sourceProvenance = with sourceTypes; [ binaryNativeCode ];
license = licenses.unfree;
platforms = map (arch: "${arch}-linux") arches;
downloadPage = "https://support.brother.com/g/b/downloadlist.aspx?c=us_ot&lang=en&prod=hll2350dw_us_eu_as&os=128";
maintainers = [ maintainers.sternenseemann ];
};
}

View File

@@ -0,0 +1,10 @@
--- a/opt/brother/Printers/HLL2375DW/cupswrapper/lpdwrapper 2022-12-07 18:32:29.950543083 +0100
+++ b/opt/brother/Printers/HLL2375DW/cupswrapper/lpdwrapper 2022-12-07 18:46:03.046989151 +0100
@@ -379,6 +379,7 @@
`cp $basedir/inf/br${PRINTER}rc $TEMPRC`;
+`chmod 666 $TEMPRC`;
$ENV{BRPRINTERRCFILE} = $TEMPRC;
logprint( 0 , "TEMPRC = $TEMPRC\n");

View File

@@ -0,0 +1,111 @@
{
lib,
stdenv,
fetchurl,
dpkg,
autoPatchelfHook,
makeWrapper,
perl,
gnused,
ghostscript,
file,
coreutils,
gnugrep,
which,
}:
let
arches = [
"x86_64"
"i686"
"armv7l"
];
runtimeDeps = [
ghostscript
file
gnused
gnugrep
coreutils
which
];
in
stdenv.mkDerivation rec {
pname = "cups-brother-hll2375dw";
version = "4.0.0-1";
nativeBuildInputs = [
dpkg
makeWrapper
autoPatchelfHook
];
buildInputs = [ perl ];
src = fetchurl {
url = "https://download.brother.com/welcome/dlf103535//hll2375dwpdrv-${version}.i386.deb";
hash = "sha256-N5VCBZLFrfw29QjjzlSvQ12urvyaf7ez/RJ08UwqHdk=";
};
patches = [
# The brother lpdwrapper uses a temporary file to convey the printer settings.
# The original settings file will be copied with "400" permissions and the "brprintconflsr3"
# binary cannot alter the temporary file later on. This fixes the permissions so the can be modified.
# Since this is all in briefly in the temporary directory of systemd-cups and not accessible by others,
# it shouldn't be a security concern.
./fix-perm.patch
];
installPhase = ''
runHook preInstall
mkdir -p $out
cp -ar opt $out/opt
# delete unnecessary files for the current architecture
''
+ lib.concatMapStrings (arch: ''
echo Deleting files for ${arch}
rm -r "$out/opt/brother/Printers/HLL2375DW/lpd/${arch}"
'') (builtins.filter (arch: arch != stdenv.hostPlatform.linuxArch) arches)
+ ''
# bundled scripts don't understand the arch subdirectories for some reason
ln -s \
"$out/opt/brother/Printers/HLL2375DW/lpd/${stdenv.hostPlatform.linuxArch}/"* \
"$out/opt/brother/Printers/HLL2375DW/lpd/"
# Fix global references and replace auto discovery mechanism with hardcoded values
substituteInPlace $out/opt/brother/Printers/HLL2375DW/lpd/lpdfilter \
--replace "my \$BR_PRT_PATH =" "my \$BR_PRT_PATH = \"$out/opt/brother/Printers/HLL2375DW\"; #" \
--replace "PRINTER =~" "PRINTER = \"HLL2375DW\"; #"
substituteInPlace $out/opt/brother/Printers/HLL2375DW/cupswrapper/lpdwrapper \
--replace "my \$basedir = C" "my \$basedir = \"$out/opt/brother/Printers/HLL2375DW\" ; #" \
--replace "PRINTER =~" "PRINTER = \"HLL2375DW\"; #"
# Make sure all executables have the necessary runtime dependencies available
find "$out" -executable -and -type f | while read file; do
wrapProgram "$file" --prefix PATH : "${lib.makeBinPath runtimeDeps}"
done
# Symlink filter and ppd into a location where CUPS will discover it
mkdir -p $out/lib/cups/filter
mkdir -p $out/share/cups/model
mkdir -p $out/etc/opt/brother/Printers/HLL2375DW/inf
ln -s $out/opt/brother/Printers/HLL2375DW/inf/brHLL2375DWrc \
$out/etc/opt/brother/Printers/HLL2375DW/inf/brHLL2375DWrc
ln -s \
$out/opt/brother/Printers/HLL2375DW/cupswrapper/lpdwrapper \
$out/lib/cups/filter/brother_lpdwrapper_HLL2375DW
ln -s \
$out/opt/brother/Printers/HLL2375DW/cupswrapper/brother-HLL2375DW-cups-en.ppd \
$out/share/cups/model/
runHook postInstall
'';
meta = with lib; {
homepage = "http://www.brother.com/";
description = "Brother HLL2375DW printer driver";
license = licenses.unfree;
platforms = map (arch: "${arch}-linux") arches;
maintainers = [ maintainers.gador ];
};
}

View File

@@ -0,0 +1,105 @@
{
lib,
stdenv,
fetchurl,
dpkg,
autoPatchelfHook,
makeWrapper,
perl,
gnused,
ghostscript,
file,
coreutils,
gnugrep,
which,
}:
let
arches = [
"x86_64"
"i686"
"armv7l"
];
runtimeDeps = [
ghostscript
file
gnused
gnugrep
coreutils
which
];
in
stdenv.mkDerivation rec {
pname = "cups-brother-mfcl2750dw";
version = "4.0.0-1";
nativeBuildInputs = [
dpkg
makeWrapper
autoPatchelfHook
];
buildInputs = [ perl ];
dontUnpack = true;
src = fetchurl {
url = "https://download.brother.com/welcome/dlf103530/mfcl2750dwpdrv-${version}.i386.deb";
hash = "sha256-3uDwzLQTF8r1tsGZ7ChGhk4ryQmVsZYdUaj9eFaC0jc=";
};
installPhase = ''
runHook preInstall
mkdir -p $out
dpkg-deb -x $src $out
# delete unnecessary files for the current architecture
''
+ lib.concatMapStrings (arch: ''
echo Deleting files for ${arch}
rm -r "$out/opt/brother/Printers/MFCL2750DW/lpd/${arch}"
'') (builtins.filter (arch: arch != stdenv.hostPlatform.linuxArch) arches)
+ ''
# bundled scripts don't understand the arch subdirectories for some reason
ln -s \
"$out/opt/brother/Printers/MFCL2750DW/lpd/${stdenv.hostPlatform.linuxArch}/"* \
"$out/opt/brother/Printers/MFCL2750DW/lpd/"
# Fix global references and replace auto discovery mechanism with hardcoded values
substituteInPlace $out/opt/brother/Printers/MFCL2750DW/lpd/lpdfilter \
--replace /opt "$out/opt" \
--replace "my \$BR_PRT_PATH =" "my \$BR_PRT_PATH = \"$out/opt/brother/Printers/MFCL2750DW\"; #" \
--replace "PRINTER =~" "PRINTER = \"MFCL2750DW\"; #"
# Make sure all executables have the necessary runtime dependencies available
find "$out" -executable -and -type f | while read file; do
wrapProgram "$file" --prefix PATH : "${lib.makeBinPath runtimeDeps}"
done
# Symlink filter and ppd into a location where CUPS will discover it
mkdir -p $out/lib/cups/filter
mkdir -p $out/share/cups/model
ln -s \
$out/opt/brother/Printers/MFCL2750DW/lpd/lpdfilter \
$out/lib/cups/filter/brother_lpdwrapper_MFCL2750DW
ln -s \
$out/opt/brother/Printers/MFCL2750DW/cupswrapper/brother-MFCL2750DW-cups-en.ppd \
$out/share/cups/model/
runHook postInstall
'';
meta = with lib; {
homepage = "http://www.brother.com/";
description = "Brother MFC-L2750DW printer driver";
sourceProvenance = with lib.sourceTypes; [ binaryNativeCode ];
license = licenses.unfree;
platforms = map (arch: "${arch}-linux") arches;
maintainers = [ maintainers.lovesegfault ];
};
}

View File

@@ -0,0 +1,102 @@
{
lib,
stdenv,
fetchurl,
dpkg,
autoPatchelfHook,
makeWrapper,
perl,
gnused,
ghostscript,
file,
coreutils,
gnugrep,
which,
}:
let
arches = [
"x86_64"
"i686"
];
version = "4.1.0-1";
runtimeDeps = [
ghostscript
file
gnused
gnugrep
coreutils
which
];
in
stdenv.mkDerivation {
pname = "cups-brother-mfcl2800dw";
inherit version;
nativeBuildInputs = [
dpkg
makeWrapper
autoPatchelfHook
];
buildInputs = [ perl ];
dontUnpack = true;
src = fetchurl {
url = "https://download.brother.com/welcome/dlf106048/mfcl2800dwpdrv-${version}.i386.deb";
hash = "sha256-sY92w0EFI69LxoNrhluIhqFOWZQOI+SJKKyuExvasgA=";
};
installPhase = ''
runHook preInstall
mkdir -p $out
dpkg-deb -x $src $out
# delete unnecessary files for the current architecture
''
+ lib.concatMapStrings (arch: ''
echo Deleting files for ${arch}
rm -r "$out/opt/brother/Printers/MFCL2800DW/lpd/${arch}"
'') (builtins.filter (arch: arch != stdenv.hostPlatform.linuxArch) arches)
+ ''
# bundled scripts don't understand the arch subdirectories for some reason
ln -s \
"$out/opt/brother/Printers/MFCL2800DW/lpd/${stdenv.hostPlatform.linuxArch}/"* \
"$out/opt/brother/Printers/MFCL2800DW/lpd/"
# Fix global references and replace auto discovery mechanism with hardcoded values
substituteInPlace $out/opt/brother/Printers/MFCL2800DW/lpd/lpdfilter \
--replace-fail /opt "$out/opt" \
--replace-fail "my \$BR_PRT_PATH =" "my \$BR_PRT_PATH = \"$out/opt/brother/Printers/MFCL2800DW\"; #" \
--replace-fail "PRINTER =~" "PRINTER = \"MFCL2800DW\"; #"
# Make sure all executables have the necessary runtime dependencies available
find "$out" -executable -and -type f | while read file; do
wrapProgram "$file" --prefix PATH : "${lib.makeBinPath runtimeDeps}"
done
# Symlink filter and ppd into a location where CUPS will discover it
mkdir -p $out/lib/cups/filter $out/share/cups/model
ln -s \
$out/opt/brother/Printers/MFCL2800DW/lpd/lpdfilter \
$out/lib/cups/filter/brother_lpdwrapper_MFCL2800DW
ln -s \
$out/opt/brother/Printers/MFCL2800DW/cupswrapper/brother-MFCL2800DW-cups-en.ppd \
$out/share/cups/model/
runHook postInstall
'';
meta = {
homepage = "http://www.brother.com/";
description = "Brother MFC-L2750DW printer driver";
sourceProvenance = with lib.sourceTypes; [ binaryNativeCode ];
license = lib.licenses.unfree;
platforms = map (arch: "${arch}-linux") arches;
maintainers = [ lib.maintainers.luftmensch-luftmensch ];
};
}

View File

@@ -0,0 +1,57 @@
{
autoreconfHook,
avahi,
cups,
fetchFromGitHub,
glib,
lib,
libcupsfilters,
libppd,
pkg-config,
stdenv,
}:
stdenv.mkDerivation rec {
pname = "cups-browsed";
version = "2.1.1";
src = fetchFromGitHub {
owner = "OpenPrinting";
repo = "cups-browsed";
rev = version;
hash = "sha256-Cfk28rxxgzzQs7B+tNmeUzDYL1eCx9zYwRsS/J6QX9s=";
};
nativeBuildInputs = [
autoreconfHook
cups
glib # Required for gdbus-codegen
pkg-config
];
buildInputs = [
avahi
cups
glib
libcupsfilters
libppd
];
configureFlags = [
"--with-rcdir=no"
];
makeFlags = [
"CUPS_SERVERBIN=$(out)/lib/cups"
"CUPS_DATADIR=$(out)/share/cups"
"CUPS_SERVERROOT=$(out)/etc/cups"
];
meta = {
description = "Daemon for browsing the Bonjour broadcasts of shared, remote CUPS printers";
homepage = "https://github.com/OpenPrinting/cups-browsed";
license = lib.licenses.asl20;
mainProgram = "cups-browsed";
platforms = lib.platforms.linux;
};
}

View File

@@ -0,0 +1,63 @@
{
lib,
fetchzip,
fetchpatch,
cups,
python3Packages,
patchPpdFilesHook,
}:
python3Packages.buildPythonApplication rec {
pname = "rastertosag-gdi";
version = "0.1";
src = fetchzip {
url = "https://www.openprinting.org/download/printing/${pname}/${pname}-${version}.tar.gz";
sha256 = "1ldplpv497j8vhw24sksg3fiw8c5pqr0wajajh7p5xpvb6zlcmvw";
};
patches = [
# port to python 3
(fetchpatch {
url = "https://sources.debian.org/data/main/r/${pname}/0.1-7/debian/patches/0001-${pname}-python3.patch";
sha256 = "1l3xbrs67025595k9ba5794q3s74anizpbxwsshcfhmbrzd9h8hg";
})
];
format = "other";
nativeBuildInputs = [
(lib.getBin cups)
patchPpdFilesHook
];
# The source image also brings pre-built ppd files,
# but we prefer to generate from source where possible, so
# the following line generates ppd files from the drv file.
postBuild = ''
ppdc -v -d . -I "${cups}/share/cups/ppdc" rastertosag-gdi.drv
'';
installPhase = ''
runHook preInstall
install -vDm 0644 -t "${placeholder "out"}/share/cups/model/rastertosag-gdi/" *.ppd
install -vDm 0755 -t "${placeholder "out"}/bin/" rastertosag-gdi
install -vd "${placeholder "out"}/lib/cups/filter/"
ln -vst "${placeholder "out"}/lib/cups/filter/" "${placeholder "out"}/bin/rastertosag-gdi"
runHook postInstall
'';
ppdFileCommands = [ "rastertosag-gdi" ];
postFixup = ''
gzip -9nv "${placeholder "out"}/share/cups/model/rastertosag-gdi"/*.ppd
'';
meta = {
description = "CUPS driver for Ricoh Aficio SP 1000S and SP 1100S printers";
mainProgram = "rastertosag-gdi";
downloadPage = "https://www.openprinting.org/download/printing/rastertosag-gdi/";
homepage = "https://www.openprinting.org/driver/rastertosag-gdi/";
license = lib.licenses.free; # just "GPL", according to README
maintainers = [ lib.maintainers.yarny ];
longDescription = ''
This package brings CUPS raster filter
for Ricoh Aficio SP 1000S and SP 1100S.
In contrast to other Ricoh laser printers,
they use the proprietary SAG-GDI raster format by
Sagem Communication and do not understand PCL or PostScript.
Therefore they do not work with Ricoh's PPD files.
'';
};
}

View File

@@ -0,0 +1,80 @@
diff -rp dymo-cups-drivers-1.4.0.5/src/common/CupsFilter.h dymo-cups-drivers-1.4.0.5-fix/src/common/CupsFilter.h
*** dymo-cups-drivers-1.4.0.5/src/common/CupsFilter.h 2012-02-07 14:22:37.000000000 +0100
--- dymo-cups-drivers-1.4.0.5-fix/src/common/CupsFilter.h 2017-03-27 23:10:17.638976126 +0200
***************
*** 22,29 ****
--- 22,31 ----
#define hfc4bbdea_8a1b_427c_9ab5_50b84576b19e
#include <cups/cups.h>
+ #include <cups/ppd.h>
#include <cups/raster.h>
#include <memory>
+ #include <stdio.h>
#include <string>
#include "CupsPrintEnvironment.h"
#include "ErrorDiffusionHalftoning.h"
diff -rp dymo-cups-drivers-1.4.0.5/src/common/CupsPrintEnvironment.h dymo-cups-drivers-1.4.0.5-fix/src/common/CupsPrintEnvironment.h
*** dymo-cups-drivers-1.4.0.5/src/common/CupsPrintEnvironment.h 2012-02-07 14:22:37.000000000 +0100
--- dymo-cups-drivers-1.4.0.5-fix/src/common/CupsPrintEnvironment.h 2017-03-27 23:10:17.638976126 +0200
***************
*** 22,27 ****
--- 22,28 ----
#define h952b1c81_8931_433a_8479_7ae6d8e85a86
#include "PrinterDriver.h"
+ #include <stdio.h>
namespace DymoPrinterDriver
{
diff -rp dymo-cups-drivers-1.4.0.5/src/lm/CupsFilterLabelManager.h dymo-cups-drivers-1.4.0.5-fix/src/lm/CupsFilterLabelManager.h
*** dymo-cups-drivers-1.4.0.5/src/lm/CupsFilterLabelManager.h 2012-02-07 14:22:38.000000000 +0100
--- dymo-cups-drivers-1.4.0.5-fix/src/lm/CupsFilterLabelManager.h 2017-03-27 23:10:17.635976126 +0200
***************
*** 22,27 ****
--- 22,28 ----
#define he780684b_6efc_428d_bfdb_c5422b1ed982
#include <cups/cups.h>
+ #include <cups/ppd.h>
#include <cups/raster.h>
#include "LabelManagerDriver.h"
#include "LabelManagerLanguageMonitor.h"
*************** public:
*** 50,53 ****
/*
* End of "$Id: CupsFilterLabelManager.h 14880 2011-03-31 16:29:05Z aleksandr $".
! */
\ No newline at end of file
--- 51,54 ----
/*
* End of "$Id: CupsFilterLabelManager.h 14880 2011-03-31 16:29:05Z aleksandr $".
! */
diff -rp dymo-cups-drivers-1.4.0.5/src/lw/CupsFilterLabelWriter.h dymo-cups-drivers-1.4.0.5-fix/src/lw/CupsFilterLabelWriter.h
*** dymo-cups-drivers-1.4.0.5/src/lw/CupsFilterLabelWriter.h 2012-02-07 14:22:37.000000000 +0100
--- dymo-cups-drivers-1.4.0.5-fix/src/lw/CupsFilterLabelWriter.h 2017-03-27 23:10:17.632976126 +0200
***************
*** 22,27 ****
--- 22,28 ----
#define hd8574b83_b264_47b2_8d33_a46ae75691d2
#include <cups/cups.h>
+ #include <cups/ppd.h>
#include <cups/raster.h>
#include "LabelWriterDriver.h"
#include "LabelWriterLanguageMonitor.h"
diff -rp dymo-cups-drivers-1.4.0.5/src/common/CupsPrintEnvironment.cpp dymo-cups-drivers-1.4.0.5-fix/src/common/CupsPrintEnvironment.cpp
*** dymo-cups-drivers-1.4.0.5/src/common/CupsPrintEnvironment.cpp 2019-12-16 19:37:23.429662838 +0000
--- dymo-cups-drivers-1.4.0.5-fix/src/common/CupsPrintEnvironment.cpp 2019-12-16 19:41:48.506991614 +0000
***************
*** 23,28 ****
--- 23,29 ----
#include "CupsPrintEnvironment.h"
#include <errno.h>
#include <cups/cups.h>
+ #include <cups/sidechannel.h>
#include <cassert>
namespace DymoPrinterDriver

View File

@@ -0,0 +1,36 @@
{
stdenv,
lib,
fetchurl,
cups,
}:
stdenv.mkDerivation rec {
pname = "cups-dymo";
version = "1.4.0.5";
# exposed version and 'real' version may differ
# in this case the download states '1.4.0' but the real version is '1.4.0.5'
# this has the potential to break future builds
dl-name = "dymo-cups-drivers-1.4.0";
src = fetchurl {
url = "http://download.dymo.com/dymo/Software/Download%20Drivers/Linux/Download/${dl-name}.tar.gz";
sha256 = "0wagsrz3q7yrkzb5ws0m5faq68rqnqfap9p98sgk5jl6x7krf1y6";
};
buildInputs = [ cups ];
patches = [ ./fix-includes.patch ];
makeFlags = [
"cupsfilterdir=$(out)/lib/cups/filter"
"cupsmodeldir=$(out)/share/cups/model"
];
meta = {
description = "CUPS Linux drivers and SDK for DYMO printers";
homepage = "https://www.dymo.com/";
license = lib.licenses.gpl2Plus;
maintainers = with lib.maintainers; [ makefu ];
};
}

View File

@@ -0,0 +1,130 @@
{
lib,
bc,
coreutils,
cups,
dbus,
dejavu_fonts,
fetchFromGitHub,
fontconfig,
gawk,
ghostscript,
gnugrep,
gnused,
ijs,
libcupsfilters,
libppd,
libexif,
libjpeg,
liblouis,
libpng,
makeWrapper,
autoreconfHook,
mupdf,
perl,
pkg-config,
poppler,
poppler-utils,
qpdf,
stdenv,
which,
withAvahi ? true,
glib,
}:
(
if !withAvahi then
lib.warn "the 'withAvahi' parameter to 'cups-filters' is deprecated, as the cups-browsed component (which does not make sense without avahi) has been split out of the cups-filters package (which no longer needs avahi)"
else
lib.id
)
(
let
binPath = lib.makeBinPath [
bc
coreutils
gawk
gnused
gnugrep
which
];
in
stdenv.mkDerivation rec {
pname = "cups-filters";
version = "2.0.1";
src = fetchFromGitHub {
owner = "OpenPrinting";
repo = "cups-filters";
rev = version;
hash = "sha256-bLOl64bdeZ10JLcQ7GbU+VffJu3Lzo0ves7O7GQIOWY=";
};
strictDeps = true;
nativeBuildInputs = [
autoreconfHook
cups
glib
makeWrapper
pkg-config
];
buildInputs = [
cups
ghostscript
libcupsfilters
libppd
mupdf
];
configureFlags = [
"--with-mutool-path=${mupdf}/bin/mutool"
"--with-gs-path=${ghostscript}/bin/gs"
"--with-ippfind-path=${cups}/bin/ippfind"
"--with-shell=${stdenv.shell}"
"--localstatedir=/var"
"--sysconfdir=/etc"
];
makeFlags = [
"CUPS_SERVERBIN=$(out)/lib/cups"
"CUPS_DATADIR=$(out)/share/cups"
"CUPS_SERVERROOT=$(out)/etc/cups"
];
# https://github.com/OpenPrinting/cups-filters/issues/512
env.NIX_CFLAGS_COMPILE = "-std=c++17";
postConfigure = ''
# Ensure that bannertopdf can find the PDF templates in
# $out. (By default, it assumes that cups and cups-filters are
# installed in the same prefix.)
substituteInPlace config.h --replace ${cups.out}/share/cups/data $out/share/cups/data
# Ensure that gstoraster can find gs in $PATH.
substituteInPlace filter/gstoraster.c --replace execve execvpe
# Patch shebangs of generated build scripts
patchShebangs filter
'';
postInstall = ''
for i in $out/lib/cups/filter/*; do
wrapProgram "$i" --prefix PATH ':' ${binPath}
done
'';
enableParallelBuilding = true;
doCheck = true;
meta = {
homepage = "http://www.linuxfoundation.org/collaborate/workgroups/openprinting/cups-filters";
description = "Backends, filters, and other software that was once part of the core CUPS distribution but is no longer maintained by Apple Inc";
license = lib.licenses.gpl2Plus;
platforms = lib.platforms.linux;
};
}
)

View File

@@ -0,0 +1,55 @@
{
stdenvNoCC,
lib,
fetchurl,
autoPatchelfHook,
cups,
unzip,
}:
stdenvNoCC.mkDerivation {
pname = "cups-idprt-barcode";
version = "1.2.1";
src = fetchurl {
name = "idprt_label_printer_linux_driver.zip"; # This is not the original name, but there was debate about whether rec or finalAttrs should be used, so I just renamed it
url = "https://www.idprt.com/prt_v2/files/down_file/id/265/fid/600.html"; # NOTE: This is NOT an HTML page, but a ZIP file
hash = "sha256-jp8DDaTmCgNrHCJSSz1K3xDcSB8dQm6i1pICaMrBFaQ=";
};
buildInputs = [ cups ];
nativeBuildInputs = [
autoPatchelfHook
unzip
];
installPhase =
let
arch =
{
x86_64-linux = "x64";
x86-linux = "x86";
}
."${stdenvNoCC.hostPlatform.system}"
or (throw "cups-idprt-barcode: No prebuilt filters for system: ${stdenvNoCC.hostPlatform.system}");
in
''
runHook preInstall
mkdir -p $out/share/cups/model $out/lib/cups/filter
cp -r filter/${arch}/. $out/lib/cups/filter
cp -r ppd/. $out/share/cups/model
chmod +x $out/lib/cups/filter/*
runHook postInstall
'';
meta = {
description = "CUPS drivers for iDPRT barcode printers (iD2P, iD2X, iD4P, iD4S, iE2P, iE2X, iE4P, iE4S, iT4B, iT4E, iT4P, iT4S, iT4X, iX4E, iX4L, iX4P, iX4E, iX6P)";
platforms = [
"x86_64-linux"
"x86-linux"
];
license = lib.licenses.unfree;
sourceProvenance = with lib.sourceTypes; [ binaryNativeCode ];
maintainers = with lib.maintainers; [ pandapip1 ];
};
}

View File

@@ -0,0 +1,55 @@
{
stdenvNoCC,
lib,
fetchurl,
autoPatchelfHook,
cups,
unzip,
}:
stdenvNoCC.mkDerivation {
pname = "cups-idprt-mt888";
version = "1.2.0";
src = fetchurl {
name = "idprt_mt888_printer_linux_driver.zip";
url = "https://www.idprt.com/prt_v2/files/down_file/id/324/fid/780.html"; # NOTE: This is NOT an HTML page, but a ZIP file
hash = "sha256-fmKDRa6NOXMM6IuxRK8sjToGhdPiHO6ZdfUVvR1KKb0=";
};
buildInputs = [ cups ];
nativeBuildInputs = [
autoPatchelfHook
unzip
];
installPhase =
let
arch =
{
x86_64-linux = "x64";
x86-linux = "x86";
}
."${stdenvNoCC.hostPlatform.system}"
or (throw "cups-idprt-mt888: No prebuilt filters for system: ${stdenvNoCC.hostPlatform.system}");
in
''
runHook preInstall
mkdir -p $out/share/cups/model $out/lib/cups/filter
cp -r filter/${arch}/. $out/lib/cups/filter
cp -r ppd/. $out/share/cups/model
chmod +x $out/lib/cups/filter/*
runHook postInstall
'';
meta = {
description = "CUPS driver for the iDPRT MT888";
platforms = [
"x86_64-linux"
"x86-linux"
];
license = lib.licenses.unfree;
sourceProvenance = with lib.sourceTypes; [ binaryNativeCode ];
maintainers = with lib.maintainers; [ pandapip1 ];
};
}

View File

@@ -0,0 +1,56 @@
{
stdenvNoCC,
lib,
fetchurl,
autoPatchelfHook,
cups,
unzip,
}:
stdenvNoCC.mkDerivation {
pname = "cups-idprt-mt890";
version = "1.2.0";
src = fetchurl {
name = "idprt_mt890_printer_linux_driver.zip";
url = "https://www.idprt.com/prt_v2/files/down_file/id/320/fid/778.html"; # NOTE: This is NOT an HTML page, but a ZIP file
hash = "sha256-8yH+DSPRp4mjKOXw90TiGA4OzxJKHpBUMSLh3L2njw8=";
};
buildInputs = [ cups ];
nativeBuildInputs = [
autoPatchelfHook
unzip
];
installPhase =
let
arch =
{
x86_64-linux = "x64";
x86-linux = "x86";
}
."${stdenvNoCC.hostPlatform.system}"
or (throw "cups-idprt-mt890: No prebuilt filters for system: ${stdenvNoCC.hostPlatform.system}");
in
''
runHook preInstall
mkdir -p $out/share/cups/model $out/lib/cups/filter
cp -r filter/${arch}/. $out/lib/cups/filter
cp -r ppd/. $out/share/cups/model
rm $out/share/cups/model/*.ppd~
chmod +x $out/lib/cups/filter/*
runHook postInstall
'';
meta = {
description = "CUPS driver for the iDPRT MT890";
platforms = [
"x86_64-linux"
"x86-linux"
];
license = lib.licenses.unfree;
sourceProvenance = with lib.sourceTypes; [ binaryNativeCode ];
maintainers = with lib.maintainers; [ pandapip1 ];
};
}

View File

@@ -0,0 +1,64 @@
{
stdenvNoCC,
lib,
fetchurl,
autoPatchelfHook,
cups,
e2fsprogs,
krb5,
libxcrypt-legacy,
unzip,
}:
stdenvNoCC.mkDerivation (finalAttrs: {
pname = "cups-idprt-sp900";
version = "1.4.0";
src = fetchurl {
name = "idprt_sp900_printer_linux_driver.zip";
url = "https://www.idprt.com/prt_v2/files/down_file/id/176/fid/498.html"; # NOTE: This is NOT an HTML page, but a ZIP file
hash = "sha256-+YVQTrqpi16xX+d/ulMtffpA9X7hwtWRiS/mIAw13n8=";
};
sourceRoot = "idprt_sp900_printer_linux_driver_v${finalAttrs.version}/idprt_sp900_printer_linux_driver_v${finalAttrs.version}"; # >:|
buildInputs = [
cups
e2fsprogs
krb5
libxcrypt-legacy
];
nativeBuildInputs = [
autoPatchelfHook
unzip
];
installPhase =
let
arch =
{
x86_64-linux = "x64";
x86-linux = "x86";
}
."${stdenvNoCC.hostPlatform.system}"
or (throw "cups-idprt-sp900: No prebuilt filters for system: ${stdenvNoCC.hostPlatform.system}");
in
''
runHook preInstall
mkdir -p $out/share/cups/model $out/lib/cups/filter
cp -r filter/${arch}/. $out/lib/cups/filter
cp -r ppd/. $out/share/cups/model
chmod +x $out/lib/cups/filter/*
runHook postInstall
'';
meta = {
description = "CUPS driver for the iDPRT SP900";
platforms = [
"x86_64-linux"
"x86-linux"
];
license = lib.licenses.unfree;
sourceProvenance = with lib.sourceTypes; [ binaryNativeCode ];
maintainers = with lib.maintainers; [ pandapip1 ];
};
})

View File

@@ -0,0 +1,64 @@
{
stdenvNoCC,
lib,
fetchurl,
autoPatchelfHook,
cups,
e2fsprogs,
krb5,
libxcrypt-legacy,
unzip,
}:
stdenvNoCC.mkDerivation {
pname = "cups-idprt-tspl";
version = "1.4.7";
src = fetchurl {
name = "idprt_tspl_printer_linux_driver.zip"; # This is not the original name, but there was debate about whether rec or finalAttrs should be used, so I just renamed it
url = "https://www.idprt.com/prt_v2/files/down_file/id/283/fid/668.html"; # NOTE: This is NOT an HTML page, but a ZIP file
hash = "sha256-P3AKSqCh5onOv0itJayEJ6P5pmlkOwOh1OtUjg40BRw=";
};
buildInputs = [
cups
e2fsprogs
krb5
libxcrypt-legacy
];
nativeBuildInputs = [
autoPatchelfHook
unzip
];
installPhase =
let
arch =
{
x86_64-linux = "x64";
x86-linux = "x86";
}
."${stdenvNoCC.hostPlatform.system}"
or (throw "cups-idprt-tspl: No prebuilt filters for system: ${stdenvNoCC.hostPlatform.system}");
in
''
runHook preInstall
mkdir -p $out/share/cups/model $out/lib/cups/filter
cp -r filter/${arch}/. $out/lib/cups/filter
cp -r ppd/. $out/share/cups/model
rm $out/share/cups/model/*.ppd~
chmod +x $out/lib/cups/filter/*
runHook postInstall
'';
meta = {
description = "CUPS drivers for TSPL-based iDPRT thermal label printers (SP210, SP310, SP320, SP320E, SP410, SP410BT, SP420, SP450, SP460BT)";
platforms = [
"x86_64-linux"
"x86-linux"
];
license = lib.licenses.unfree;
sourceProvenance = with lib.sourceTypes; [ binaryNativeCode ];
maintainers = with lib.maintainers; [ pandapip1 ];
};
}

View File

@@ -0,0 +1,116 @@
{
lib,
stdenv,
fetchurl,
cups,
autoPatchelfHook,
python3Packages,
# Sets the default paper format: use "EU" for A4, or "Global" for Letter
region ? "EU",
}:
assert region == "Global" || region == "EU";
let
kyodialog_version_short = "9";
kyodialog_version_long = "9.0";
date = "20221003";
in
stdenv.mkDerivation {
pname = "cups-kyocera-3500-4500";
version = "${kyodialog_version_long}-${date}";
dontStrip = true;
src = fetchurl {
# Steps to find the release download URL:
# 1. Go to https://www.kyoceradocumentsolutions.us/en/support/downloads.html
# 2. Search for printer model, e.g. "TASKalfa 6053ci"
# 3. Locate e.g. "Linux Print Driver (9.3)" in the list
#
# Where there's no version encoded in the vendor URL, prefer a
# web.archive.org URL. That means that if the vendor updates the package
# at this URL, the package won't suddenly stop building.
urls = [
"https://web.archive.org/web/20241123173620/https://www.kyoceradocumentsolutions.us/content/download-center-americas/us/drivers/drivers/MA_PA_4500ci_Linux_gz.download.gz"
"https://www.kyoceradocumentsolutions.us/content/download-center-americas/us/drivers/drivers/MA_PA_4500ci_Linux_gz.download.gz"
];
hash = "sha256-pqBtfKiQo/+cF8fG5vsEQvr8UdxjGsSShXI+6bun03c=";
recursiveHash = true;
downloadToTemp = true;
postFetch = ''
unpackDir="$TMPDIR/unpack"
mkdir "$unpackDir"
cd "$unpackDir"
mv "$downloadedFile" "$TMPDIR/source.tar.gz.gz"
gunzip "$TMPDIR/source.tar.gz.gz"
unpackFile "$TMPDIR/source.tar.gz"
chmod -R +w "$unpackDir"
mv "$unpackDir" "$out"
# delete redundant Linux package dirs to reduce size in the Nix store; only keep Debian
rm -r $out/{CentOS,Fedora,OpenSUSE,Redhat,Ubuntu}
'';
};
sourceRoot = ".";
unpackCmd =
let
platforms = {
x86_64-linux = "amd64";
i686-linux = "i386";
};
platform =
platforms.${stdenv.hostPlatform.system}
or (throw "unsupported system: ${stdenv.hostPlatform.system}");
in
''
ar p "$src/Debian/${region}/kyodialog_${platform}/kyodialog_${kyodialog_version_long}-0_${platform}.deb" data.tar.gz | tar -xz
'';
nativeBuildInputs = [
autoPatchelfHook
python3Packages.wrapPython
];
buildInputs = [ cups ];
# For lib/cups/filter/kyofilter_pre_H.
# The source already contains a copy of pypdf3, but we use the Nix package
propagatedBuildInputs = with python3Packages; [
reportlab
pypdf3
setuptools
];
installPhase = ''
# allow cups to find the ppd files
mkdir -p $out/share/cups/model
mv ./usr/share/kyocera${kyodialog_version_short}/ppd${kyodialog_version_short} $out/share/cups/model/Kyocera
# remove absolute path prefixes to filters in ppd
find $out -name "*.ppd" -exec sed -E -i "s:/usr/lib/cups/filter/::g" {} \;
mkdir -p $out/lib/cups/
mv ./usr/lib/cups/filter/ $out/lib/cups/
# for lib/cups/filter/kyofilter_pre_H
wrapPythonProgramsIn $out/lib/cups/filter "$propagatedBuildInputs"
install -Dm444 usr/share/doc/kyodialog/copyright $out/share/doc/cups-kyocera-3500-4500/copyright
'';
meta = with lib; {
description = "CUPS drivers for Kyocera ECOSYS MA3500cix, MA3500cifx, MA4000cix, MA4000cifx, PA3500cx, PA4000cx and PA4500cx, for Kyocera CS MA4500ci and PA4500ci, and for Kyocera TASKalfa MA3500ci, MA4500ci and PI4500ci printers";
homepage = "https://www.kyoceradocumentsolutions.com";
sourceProvenance = [ sourceTypes.binaryNativeCode ];
license = licenses.unfree;
maintainers = [ maintainers.me-and ];
platforms = [
"i686-linux"
"x86_64-linux"
];
};
}

View File

@@ -0,0 +1,36 @@
{
stdenv,
lib,
fetchzip,
# can either be "EU" or "Global"; it's unclear what the difference is
region ? "Global",
# can be either "English", "French", "German", "Italian", "Portguese" or "Spanish"
language ? "English",
}:
stdenv.mkDerivation rec {
pname = "cups-kyocera-ecosys-m2x35-40-p2x35-40dnw";
version = "8.1606";
src =
let
urlVersion = builtins.replaceStrings [ "." ] [ "_" ] version;
in
fetchzip {
url = "https://www.kyoceradocumentsolutions.de/content/download-center/de/drivers/all/Linux_${urlVersion}_ECOSYS_M2x35_40_P2x35_40dnw_zip.download.zip";
sha256 = "10crxdfj62ini70vv471445zi6q0l9fmg2jsd74sp6fr0qa0kvr7";
};
installPhase = ''
mkdir -p $out/share/cups/model/Kyocera
cp ${region}/${language}/*.PPD $out/share/cups/model/Kyocera/
'';
meta = with lib; {
description = "PPD files for Kyocera ECOSYS M2040dn/M2135dn/M2540dn/M2540dw/M2635dn/M2635dw/M2640idw/M2735dw/P2040dn/M2040dw/P2235dn/P2235dw";
homepage = "https://www.kyoceradocumentsolutions.com";
license = licenses.unfree;
maintainers = with maintainers; [ hexa ];
platforms = platforms.linux;
};
}

View File

@@ -0,0 +1,30 @@
{
stdenv,
lib,
fetchzip,
# can either be "EU" or "Global"; it's unclear what the difference is
region ? "Global",
}:
stdenv.mkDerivation {
pname = "cups-kyocera-ecosys-m552x-p502x";
version = "8.1602";
src = fetchzip {
url = "https://www.kyoceradocumentsolutions.de/content/download-center/de/drivers/all/Linux_8_1602_ECOSYS_M5521_5526_P5021_5026_zip.download.zip";
sha256 = "sha256-XDH5deZmWNghfoO7JaYYvnVq++mbQ8RwLY57L2CKYaY=";
};
installPhase = ''
mkdir -p $out/share/cups/model/Kyocera
cp ${region}/English/*.PPD $out/share/cups/model/Kyocera/
'';
meta = with lib; {
description = "PPD files for Kyocera ECOSYS M5521cdn/M5521cdw/M5526cdn/M5526cdw/P5021cdn/P5021cdw/P5026cdn/P5026cdw";
homepage = "https://www.kyoceradocumentsolutions.com";
license = licenses.unfree;
maintainers = [ maintainers.mbrgm ];
platforms = platforms.linux;
};
}

View File

@@ -0,0 +1,61 @@
{
lib,
stdenv,
cups,
fetchzip,
patchPpdFilesHook,
}:
let
platform =
if stdenv.hostPlatform.system == "x86_64-linux" then
"64bit"
else if stdenv.hostPlatform.system == "i686-linux" then
"32bit"
else
throw "Unsupported system: ${stdenv.hostPlatform.system}";
libPath = lib.makeLibraryPath [ cups ];
in
stdenv.mkDerivation {
pname = "cups-kyocera";
version = "1.1203";
dontPatchELF = true;
dontStrip = true;
src = fetchzip {
url = "https://web.archive.org/web/20220709011705/https://cdn.kyostatics.net/dlc/ru/driver/all/linuxdrv_1_1203_fs-1x2xmfp.-downloadcenteritem-Single-File.downloadcenteritem.tmp/LinuxDrv_1.1203_FS-1x2xMFP.zip";
sha256 = "0z1pbgidkibv4j21z0ys8cq1lafc6687syqa07qij2qd8zp15wiz";
};
nativeBuildInputs = [ patchPpdFilesHook ];
installPhase = ''
runHook preInstall
tar -xvf ${platform}/Global/English.tar.gz
install -Dm755 English/rastertokpsl $out/lib/cups/filter/rastertokpsl
patchelf \
--set-rpath ${libPath} \
--set-interpreter $(cat $NIX_CC/nix-support/dynamic-linker) \
$out/lib/cups/filter/rastertokpsl
mkdir -p $out/share/cups/model/Kyocera
cd English
cp *.ppd $out/share/cups/model/Kyocera
runHook postInstall
'';
ppdFileCommands = [ "rastertokpsl" ];
meta = with lib; {
description = "CUPS drivers for several Kyocera FS-{1020,1025,1040,1060,1120,1125} printers";
homepage = "https://www.kyoceradocumentsolutions.ru/index/service_support/download_center.false.driver.FS1040._.EN.html#";
sourceProvenance = with sourceTypes; [ binaryNativeCode ];
license = licenses.unfree;
platforms = platforms.linux;
};
}

View File

@@ -0,0 +1,126 @@
{
lib,
stdenv,
fetchzip,
cups,
autoPatchelfHook,
python3Packages,
# Sets the default paper format: use "EU" for A4, or "Global" for Letter
region ? "EU",
# optional GUI, quite redundant to CUPS admin web GUI
withQtGui ? false,
qt5,
}:
# Open issues:
#
# Printing in grayscale mode (e.g. the test page) generates a warning
# > [Job 59] Grayscale/monochrome printing requested for this job but Poppler is not able to convert to grayscale/monochrome PostScript.
# > [Job 59] Use \"pdftops-renderer\" option (see cups-filters README file) to use Ghostscript or MuPDF for the PDF -> PostScript conversion.
#
# This is related to https://github.com/OpenPrinting/cups-filters/issues/169.
assert region == "Global" || region == "EU";
let
kyodialog_version = "9.3";
date = "20230720";
in
stdenv.mkDerivation rec {
pname = "cups-kyodialog";
version = "${kyodialog_version}-${date}";
dontStrip = true;
src = fetchzip {
# Steps to find the release download URL:
# 1. Go to https://www.kyoceradocumentsolutions.us/en/support/downloads.html
# 2. Search for printer model, e.g. "TASKalfa 6053ci"
# 3. Locate e.g. "Linux Print Driver (9.3)" in the list
urls = [
"https://www.kyoceradocumentsolutions.us/content/download-center-americas/us/drivers/drivers/KyoceraLinuxPackages_${date}_tar_gz.download.gz"
"https://web.archive.org/web/20231021143259/https://www.kyoceradocumentsolutions.us/content/download-center-americas/us/drivers/drivers/KyoceraLinuxPackages_${date}_tar_gz.download.gz"
];
hash = "sha256-3h2acOmaQIiqe2Fd9QiqEfre5TrxzRrll6UlUruwj1o=";
extension = "tar.gz";
stripRoot = false;
postFetch = ''
# delete redundant Linux package dirs to reduce size in the Nix store; only keep Debian
rm -r $out/{CentOS,Fedora,OpenSUSE,Redhat,Ubuntu}
'';
};
sourceRoot = ".";
unpackCmd =
let
platforms = {
x86_64-linux = "amd64";
i686-linux = "i386";
};
platform =
platforms.${stdenv.hostPlatform.system}
or (throw "unsupported system: ${stdenv.hostPlatform.system}");
in
''
ar p "$src/Debian/${region}/kyodialog_${platform}/kyodialog_${kyodialog_version}-0_${platform}.deb" data.tar.gz | tar -xz
'';
nativeBuildInputs = [
autoPatchelfHook
python3Packages.wrapPython
]
++ lib.optionals withQtGui [ qt5.wrapQtAppsHook ];
buildInputs = [ cups ] ++ lib.optionals withQtGui [ qt5.qtbase ];
# For lib/cups/filter/kyofilter_pre_H.
# The source already contains a copy of pypdf3, but we use the Nix package
propagatedBuildInputs = with python3Packages; [
reportlab
pypdf3
setuptools
];
installPhase = ''
# allow cups to find the ppd files
mkdir -p $out/share/cups/model
mv ./usr/share/kyocera${kyodialog_version}/ppd${kyodialog_version} $out/share/cups/model/Kyocera
# remove absolute path prefixes to filters in ppd
find $out -name "*.ppd" -exec sed -E -i "s:/usr/lib/cups/filter/::g" {} \;
mkdir -p $out/lib/cups/
mv ./usr/lib/cups/filter/ $out/lib/cups/
# for lib/cups/filter/kyofilter_pre_H
wrapPythonProgramsIn $out/lib/cups/filter "$propagatedBuildInputs"
install -Dm444 usr/share/doc/kyodialog/copyright $out/share/doc/${pname}/copyright
''
+ lib.optionalString withQtGui ''
install -D usr/bin/kyoPPDWrite_H $out/bin/kyoPPDWrite_H
install -D usr/bin/kyodialog${kyodialog_version} $out/bin/kyodialog
install -Dm444 usr/share/kyocera${kyodialog_version}/appicon_H.png $out/share/${pname}/icons/appicon_H.png
install -Dm444 usr/share/applications/kyodialog${kyodialog_version}.desktop $out/share/applications/kyodialog.desktop
substituteInPlace $out/share/applications/kyodialog.desktop \
--replace Exec=\"/usr/bin/kyodialog${kyodialog_version}\" Exec=\"$out/bin/kyodialog\" \
--replace Icon=/usr/share/kyocera/appicon_H.png Icon=$out/share/${pname}/icons/appicon_H.png
'';
meta = with lib; {
description = "CUPS drivers for several Kyocera printers";
homepage = "https://www.kyoceradocumentsolutions.com";
sourceProvenance = with sourceTypes; [ binaryNativeCode ];
license = licenses.unfree;
maintainers = [ maintainers.steveej ];
platforms = [
"i686-linux"
"x86_64-linux"
];
};
}

View File

@@ -0,0 +1,64 @@
{
lib,
stdenv,
fetchFromGitHub,
cups,
coreutils,
nixosTests,
}:
stdenv.mkDerivation {
pname = "cups-pdf-to-pdf";
version = "0-unstable-2021-12-22";
src = fetchFromGitHub {
owner = "alexivkin";
repo = "CUPS-PDF-to-PDF";
rev = "c14428c2ca8e95371daad7db6d11c84046b1a2d4";
hash = "sha256-pa4PFf8OAFSra0hSazmKUfbMYL/cVWvYA1lBf7c7jmY=";
};
buildInputs = [ cups ];
postPatch = ''
substituteInPlace cups-pdf.c \
--replace-fail '"cp ' '"${lib.getExe' coreutils "cp"} '
'';
# gcc command line is taken from original cups-pdf's README file
# https://fossies.org/linux/cups-pdf/README
# however, we replace gcc with $CC following
# https://nixos.org/manual/nixpkgs/stable/#sec-darwin
buildPhase = ''
runHook preBuild
$CC -O9 -s cups-pdf.c -o cups-pdf -lcups
runHook postBuild
'';
installPhase = ''
runHook preInstall
install -Dt $out/lib/cups/backend cups-pdf
install -Dm 0644 -t $out/etc/cups cups-pdf.conf
install -Dm 0644 -t $out/share/cups/model *.ppd
runHook postInstall
'';
passthru.tests.vmtest = nixosTests.cups-pdf;
meta = {
description = "CUPS backend that turns print jobs into searchable PDF files";
homepage = "https://github.com/alexivkin/CUPS-PDF-to-PDF";
license = lib.licenses.gpl2Only;
maintainers = [ lib.maintainers.yarny ];
longDescription = ''
cups-pdf is a CUPS backend that generates a PDF file for each print job and puts this file
into a folder on the local machine such that the print job's owner can access the file.
https://www.cups-pdf.de/
cups-pdf-to-pdf is a fork of cups-pdf which tries hard to preserve the original text of the print job by avoiding rasterization.
Note that in order to use this package, you have to make sure that the cups-pdf program is called with root privileges.
'';
};
}

View File

@@ -0,0 +1,47 @@
{
lib,
stdenv,
fetchurl,
intltool,
pkg-config,
glib,
polkit,
cups,
fetchpatch,
}:
stdenv.mkDerivation rec {
version = "0.2.6";
pname = "cups-pk-helper";
src = fetchurl {
url = "https://www.freedesktop.org/software/cups-pk-helper/releases/cups-pk-helper-${version}.tar.xz";
sha256 = "0a52jw6rm7lr5nbyksiia0rn7sasyb5cjqcb95z1wxm2yprgi6lm";
};
nativeBuildInputs = [
pkg-config
intltool
];
buildInputs = [
glib
polkit
cups
];
patches = [
# Don't use etc/dbus-1/system.d
(fetchpatch {
url = "https://gitlab.freedesktop.org/cups-pk-helper/cups-pk-helper/merge_requests/2.patch";
sha256 = "1kamhr5kn8c1y0q8xbip0fgr7maf3dyddlvab4n0iypk7rwwikl0";
})
];
meta = with lib; {
description = "PolicyKit helper to configure cups with fine-grained privileges";
homepage = "https://www.freedesktop.org/wiki/Software/cups-pk-helper/";
license = licenses.gpl2Plus;
platforms = platforms.linux;
maintainers = [ maintainers.bjornfor ];
};
}

View File

@@ -0,0 +1,45 @@
{
lib,
fetchFromGitHub,
python3,
}:
python3.pkgs.buildPythonApplication rec {
pname = "cups-printers";
version = "1.0.0";
pyproject = true;
src = fetchFromGitHub {
owner = "audiusGmbH";
repo = "cups-printers";
tag = version;
hash = "sha256-HTR9t9ElQmCzJfdWyu+JQ8xBfDNpXl8XtNsJxGSfBXk=";
};
pythonRelaxDeps = [
"typer"
"validators"
];
build-system = with python3.pkgs; [ poetry-core ];
dependencies = with python3.pkgs; [
pycups
typer
validators
];
# Project has no tests
doCheck = false;
pythonImportsCheck = [ "cups_printers" ];
meta = {
description = "Tool for interacting with a CUPS server";
homepage = "https://github.com/audiusGmbH/cups-printers";
changelog = "https://github.com/audiusGmbH/cups-printers/blob/${version}/CHANGELOG.md";
license = lib.licenses.mit;
maintainers = with lib.maintainers; [ fab ];
mainProgram = "cups-printers";
};
}

View File

@@ -0,0 +1,55 @@
{
lib,
stdenv,
fetchurl,
perl,
}:
stdenv.mkDerivation {
pname = "cups-toshiba-estudio";
version = "7.89";
src = fetchurl {
url = "http://business.toshiba.com/downloads/KB/f1Ulds/15178/TOSHIBA_ColorMFP_CUPS.tar";
sha256 = "0qz4r7q55i0adf4fv3aqnfqgi2pz3jb1jixkqm9x6nk4vanyjf4r";
};
buildInputs = [ perl ];
patchPhase = ''
patchShebangs lib/
gunzip share/cups/model/Toshiba/TOSHIBA_ColorMFP_CUPS.gz
sed -i "s+/usr+$out+" share/cups/model/Toshiba/TOSHIBA_ColorMFP_CUPS
gzip share/cups/model/Toshiba/TOSHIBA_ColorMFP_CUPS
'';
installPhase = ''
mkdir -p $out/lib/cups/filter
mkdir -p $out/share/cups/model/Toshiba
cp {.,$out}/lib/cups/filter/est6550_Authentication
chmod 755 $out/lib/cups/filter/est6550_Authentication
cp {.,$out}/share/cups/model/Toshiba/TOSHIBA_ColorMFP_CUPS.gz
chmod 755 $out/share/cups/model/Toshiba/TOSHIBA_ColorMFP_CUPS.gz
'';
meta = with lib; {
description = "Printer only driver for the Toshiba e-STUDIO class of printers";
longDescription = ''
This driver supports the following printers: TOSHIBA e-STUDIO2000AC,
TOSHIBA e-STUDIO2005AC, TOSHIBA e-STUDIO2040C, TOSHIBA e-STUDIO2050C,
TOSHIBA e-STUDIO2055C, TOSHIBA e-STUDIO2500AC, TOSHIBA e-STUDIO2505AC,
TOSHIBA e-STUDIO2540C, TOSHIBA e-STUDIO2550C, TOSHIBA e-STUDIO2555C,
TOSHIBA e-STUDIO287CS, TOSHIBA e-STUDIO3005AC, TOSHIBA e-STUDIO3040C,
TOSHIBA e-STUDIO3055C, TOSHIBA e-STUDIO347CS, TOSHIBA e-STUDIO3505AC,
TOSHIBA e-STUDIO3540C, TOSHIBA e-STUDIO3555C, TOSHIBA e-STUDIO407CS,
TOSHIBA e-STUDIO4505AC, TOSHIBA e-STUDIO4540C, TOSHIBA e-STUDIO4555C,
TOSHIBA e-STUDIO5005AC, TOSHIBA e-STUDIO5055C, TOSHIBA e-STUDIO5506AC,
TOSHIBA e-STUDIO5540C, TOSHIBA e-STUDIO5560C, TOSHIBA e-STUDIO6506AC,
TOSHIBA e-STUDIO6540C, TOSHIBA e-STUDIO6550C, TOSHIBA e-STUDIO6560C,
TOSHIBA e-STUDIO6570C and TOSHIBA e-STUDIO7506AC.
'';
homepage = "https://business.toshiba.com/support/downloads/index.html";
license = licenses.unfree;
maintainers = [ maintainers.jpotier ];
};
}

View File

@@ -0,0 +1,33 @@
{
lib,
stdenv,
fetchFromGitHub,
cups,
}:
stdenv.mkDerivation {
pname = "cups-zj-58";
version = "2018-02-22";
src = fetchFromGitHub {
owner = "klirichek";
repo = "zj-58";
rev = "e4212cd702113a4bd4d7013744291c9f60bc5273";
sha256 = "1w2qkspm4qqg5h8n6gmakzhiww7gag64chvy9kf89xsl3wsyp6pi";
};
buildInputs = [ cups ];
installPhase = ''
install -D rastertozj $out/lib/cups/filter/rastertozj
install -D ZJ-58.ppd $out/share/cups/model/zjiang/ZJ-58.ppd
'';
meta = with lib; {
description = "CUPS filter for thermal printer Zjiang ZJ-58";
homepage = "https://github.com/klirichek/zj-58";
platforms = platforms.linux;
maintainers = with maintainers; [ makefu ];
license = licenses.bsd2;
};
}

View File

@@ -0,0 +1,186 @@
{
lib,
stdenv,
fetchurl,
pkg-config,
removeReferencesTo,
zlib,
libjpeg,
libpng,
libtiff,
pam,
dbus,
enableSystemd ? lib.meta.availableOn stdenv.hostPlatform systemd,
systemd,
acl,
gmp,
darwin,
libusb1 ? null,
gnutls ? null,
avahi ? null,
libpaper ? null,
coreutils,
nixosTests,
}:
stdenv.mkDerivation rec {
pname = "cups";
version = "2.4.14";
src = fetchurl {
url = "https://github.com/OpenPrinting/cups/releases/download/v${version}/cups-${version}-source.tar.gz";
hash = "sha256-ZgKIAg3W95yveZgRxMGjIHpIaJiZrCCTlZ1wo73Ldpk=";
};
outputs = [
"out"
"lib"
"dev"
"man"
];
postPatch = ''
substituteInPlace cups/testfile.c \
--replace 'cupsFileFind("cat", "/bin' 'cupsFileFind("cat", "${coreutils}/bin'
# The cups.socket unit shouldn't be part of cups.service: stopping the
# service would stop the socket and break subsequent socket activations.
# See https://github.com/apple/cups/issues/6005
sed -i '/PartOf=cups.service/d' scheduler/cups.socket.in
''
+
lib.optionalString
(stdenv.hostPlatform.isDarwin && lib.versionOlder stdenv.hostPlatform.darwinSdkVersion "12")
''
substituteInPlace backend/usb-darwin.c \
--replace "kIOMainPortDefault" "kIOMasterPortDefault"
'';
nativeBuildInputs = [
pkg-config
removeReferencesTo
];
buildInputs = [
zlib
libjpeg
libpng
libtiff
libusb1
gnutls
libpaper
]
++ lib.optionals stdenv.hostPlatform.isLinux [
avahi
pam
dbus
acl
]
++ lib.optional enableSystemd systemd;
propagatedBuildInputs = [ gmp ];
configurePlatforms = lib.optionals stdenv.hostPlatform.isLinux [
"build"
"host"
];
configureFlags = [
"--localstatedir=/var"
"--sysconfdir=/etc"
"--enable-raw-printing"
"--enable-threads"
]
++ lib.optionals stdenv.hostPlatform.isLinux [
"--enable-dbus"
"--enable-pam"
"--with-dbusdir=${placeholder "out"}/share/dbus-1"
]
++ lib.optional (libusb1 != null) "--enable-libusb"
++ lib.optional (gnutls != null) "--enable-ssl"
++ lib.optional (avahi != null) "--enable-avahi"
++ lib.optional (libpaper != null) "--enable-libpaper";
# AR has to be an absolute path
preConfigure = ''
export AR="${lib.getBin stdenv.cc.bintools.bintools}/bin/${stdenv.cc.targetPrefix}ar"
configureFlagsArray+=(
# Put just lib/* and locale into $lib; this didn't work directly.
# lib/cups is moved back to $out in postInstall.
# Beware: some parts of cups probably don't fully respect these.
"--prefix=$lib"
"--datadir=$out/share"
"--localedir=$lib/share/locale"
"--with-systemd=$out/lib/systemd/system"
${lib.optionalString stdenv.hostPlatform.isDarwin ''
"--with-bundledir=$out"
''}
)
'';
installFlags = [
# Don't try to write in /var at build time.
"CACHEDIR=$(TMPDIR)/dummy"
"LAUNCHD_DIR=$(TMPDIR)/dummy"
"LOGDIR=$(TMPDIR)/dummy"
"REQUESTS=$(TMPDIR)/dummy"
"STATEDIR=$(TMPDIR)/dummy"
# Idem for /etc.
"PAMDIR=$(out)/etc/pam.d"
"XINETD=$(out)/etc/xinetd.d"
"SERVERROOT=$(out)/etc/cups"
# Idem for /usr.
"MENUDIR=$(out)/share/applications"
"ICONDIR=$(out)/share/icons"
# Work around a Makefile bug.
"CUPS_PRIMARY_SYSTEM_GROUP=root"
];
enableParallelBuilding = true;
postInstall = ''
libexec=${if stdenv.hostPlatform.isDarwin then "libexec/cups" else "lib/cups"}
moveToOutput $libexec "$out"
# $lib contains references to $out/share/cups.
# CUPS is working without them, so they are not vital.
find "$lib" -type f -exec grep -q "$out" {} \; \
-printf "removing references from %p\n" \
-exec remove-references-to -t "$out" {} +
# Delete obsolete stuff that conflicts with cups-filters.
rm -rf $out/share/cups/banners $out/share/cups/data/testprint
moveToOutput bin/cups-config "$dev"
sed -e "/^cups_serverbin=/s|$lib|$out|" \
-i "$dev/bin/cups-config"
for f in "$out"/lib/systemd/system/*; do
substituteInPlace "$f" --replace "$lib/$libexec" "$out/$libexec"
done
''
+ lib.optionalString stdenv.hostPlatform.isLinux ''
# Use xdg-open when on Linux
substituteInPlace "$out"/share/applications/cups.desktop \
--replace "Exec=htmlview" "Exec=xdg-open"
'';
passthru.tests = {
inherit (nixosTests)
cups-pdf
printing-service
printing-socket
printing-service-notcp
printing-socket-notcp
;
};
meta = with lib; {
homepage = "https://openprinting.github.io/cups/";
description = "Standards-based printing system for UNIX";
license = licenses.asl20;
maintainers = with maintainers; [ matthewbauer ];
platforms = platforms.unix;
};
}

View File

@@ -0,0 +1,131 @@
{
lib,
stdenv,
stdenvNoCC,
fetchurl,
writeScriptBin,
appimageTools,
copyDesktopItems,
makeDesktopItem,
nix-update-script,
wrapGAppsHook3,
}:
stdenvNoCC.mkDerivation rec {
pname = "cura-appimage";
version = "5.10.2";
# Give some good names so the intermediate packages are easy
# to recognise by name in the Nix store.
appimageBinName = "cura-appimage-tools-output";
wrapperScriptName = "${pname}-wrapper-script";
src = fetchurl {
url = "https://github.com/Ultimaker/Cura/releases/download/${version}/Ultimaker-Cura-${version}-linux-X64.AppImage";
hash = "sha256-930jrjNdUE0vxuMslQNbkdm2eLAFBSsVFxlTi56a8Xg=";
};
appimageContents = appimageTools.extract {
inherit pname version src;
};
curaAppimageToolsWrapped = appimageTools.wrapType2 {
inherit src;
# For `appimageTools.wrapType2`, `pname` determines the binary's name in `bin/`.
pname = appimageBinName;
inherit version;
extraPkgs = _: [ ];
};
# The `QT_QPA_PLATFORM=xcb` fixes Wayland support, see https://github.com/NixOS/nixpkgs/issues/186570#issuecomment-2526277637
# The `GTK_USE_PORTAL=1` fixes file dialog issues under Gnome, see https://github.com/NixOS/nixpkgs/pull/372614#issuecomment-2585663161
script = writeScriptBin wrapperScriptName ''
#!${stdenv.shell}
# AppImage version of Cura loses current working directory and treats all paths relateive to $HOME.
# So we convert each of the files passed as argument to an absolute path.
# This fixes use cases like `cd /path/to/my/files; cura mymodel.stl anothermodel.stl`.
args=()
for a in "$@"; do
if [ -e "$a" ]; then
a="$(realpath "$a")"
fi
args+=("$a")
done
QT_QPA_PLATFORM=xcb GTK_USE_PORTAL=1 exec "${curaAppimageToolsWrapped}/bin/${appimageBinName}" "''${args[@]}"
'';
dontUnpack = true;
nativeBuildInputs = [
copyDesktopItems
wrapGAppsHook3
];
desktopItems = [
# Based on upstream.
# https://github.com/Ultimaker/Cura/blob/382b98e8b0c910fdf8b1509557ae8afab38f1817/packaging/AppImage/cura.desktop.jinja
(makeDesktopItem {
name = "cura";
desktopName = "UltiMaker Cura";
genericName = "3D Printing Software";
comment = meta.longDescription;
exec = "cura";
icon = "cura-icon";
terminal = false;
type = "Application";
mimeTypes = [
"model/stl"
"application/vnd.ms-3mfdocument"
"application/prs.wavefront-obj"
"image/bmp"
"image/gif"
"image/jpeg"
"image/png"
"text/x-gcode"
"application/x-amf"
"application/x-ply"
"application/x-ctm"
"model/vnd.collada+xml"
"model/gltf-binary"
"model/gltf+json"
"model/vnd.collada+xml+zip"
];
categories = [ "Graphics" ];
keywords = [
"3D"
"Printing"
];
})
];
installPhase = ''
runHook preInstall
mkdir -p $out/bin
cp ${script}/bin/${wrapperScriptName} $out/bin/cura
mkdir -p $out/share/applications $out/share/icons/hicolor/128x128/apps
install -Dm644 ${appimageContents}/usr/share/icons/hicolor/128x128/apps/cura-icon.png $out/share/icons/hicolor/128x128/apps/cura-icon.png
runHook postInstall
'';
passthru.updateScript = nix-update-script { extraArgs = [ "--version-regex=([56789].+)" ]; };
meta = {
description = "3D printing software";
homepage = "https://github.com/ultimaker/cura";
changelog = "https://github.com/Ultimaker/Cura/releases/tag/${version}";
longDescription = ''
Cura converts 3D models into paths for a 3D printer. It prepares your print for maximum accuracy, minimum printing time and good reliability with many extra features that make your print come out great.
'';
license = lib.licenses.lgpl3Plus;
platforms = [ "x86_64-linux" ];
mainProgram = "cura";
maintainers = with lib.maintainers; [
pbek
nh2
fliegendewurst
];
};
}

View File

@@ -0,0 +1,34 @@
{
lib,
stdenvNoCC,
fetchurl,
}:
stdenvNoCC.mkDerivation rec {
pname = "curie";
version = "1.0";
src = fetchurl {
url = "https://github.com/oppiliappan/curie/releases/download/v${version}/curie-v${version}.tar.gz";
hash = "sha256-B89GNbOmm3lY/cRWQJEFu/5morCM/WrRQb/m6covbt8=";
};
sourceRoot = ".";
installPhase = ''
runHook preInstall
mkdir -p $out/share/fonts/misc
install *.otb $out/share/fonts/misc
runHook postInstall
'';
meta = with lib; {
description = "Upscaled version of scientifica";
homepage = "https://github.com/oppiliappan/curie";
license = licenses.ofl;
platforms = platforms.all;
maintainers = with maintainers; [ moni ];
};
}

View File

@@ -0,0 +1,206 @@
{
lib,
stdenv,
fetchFromGitHub,
callPackage,
buildGoModule,
installShellFiles,
buildPackages,
zlib,
zstd,
sqlite,
cmake,
python3,
ninja,
perl,
pkg-config,
autoconf,
automake,
libtool,
cctools,
cacert,
unzip,
go,
p11-kit,
}:
stdenv.mkDerivation rec {
pname = "curl-impersonate-chrome";
version = "1.2.0";
outputs = [
"out"
"dev"
];
src = fetchFromGitHub {
owner = "lexiforest";
repo = "curl-impersonate";
rev = "v${version}";
hash = "sha256-tAQdTRGAOD2rpLZvoLQ2YL0wrohXEcmChMZBvYjsMhE=";
};
# Disable blanket -Werror to fix build on `gcc-13` related to minor
# warnings on `boringssl`.
env.NIX_CFLAGS_COMPILE = "-Wno-error";
strictDeps = true;
depsBuildBuild = lib.optionals (stdenv.buildPlatform != stdenv.hostPlatform) [
buildPackages.stdenv.cc
];
nativeBuildInputs =
lib.optionals stdenv.hostPlatform.isDarwin [
# Must come first so that it shadows the 'libtool' command but leaves 'libtoolize'
cctools
]
++ [
installShellFiles
cmake
python3
python3.pythonOnBuildForHost.pkgs.gyp
ninja
perl
pkg-config
autoconf
automake
libtool
unzip
go
];
buildInputs = [
zlib
zstd
sqlite
];
configureFlags = [
"--with-ca-bundle=${
if stdenv.hostPlatform.isDarwin then "/etc/ssl/cert.pem" else "/etc/ssl/certs/ca-certificates.crt"
}"
"--with-ca-path=${cacert}/etc/ssl/certs"
];
buildFlags = [ "build" ];
checkTarget = "checkbuild";
installTargets = [ "install" ];
doCheck = true;
dontUseCmakeConfigure = true;
dontUseNinjaBuild = true;
dontUseNinjaInstall = true;
dontUseNinjaCheck = true;
postUnpack =
lib.concatStringsSep "\n" (
lib.mapAttrsToList (name: dep: "ln -sT ${dep.outPath} ${src.name}/${name}") (
lib.filterAttrs (n: v: v ? outPath) passthru.deps
)
)
+ ''
curltar=$(realpath -s ${src.name}/curl-*.tar.gz)
pushd "$(mktemp -d)"
tar -xf "$curltar"
pushd curl-curl-*/
patchShebangs scripts
popd
rm "$curltar"
tar -czf "$curltar" .
popd
'';
postPatch = ''
substituteInPlace Makefile.in \
--replace-fail "-lc++" "-lstdc++"
'';
preConfigure = ''
export GOCACHE=$TMPDIR/go-cache
export GOPATH=$TMPDIR/go
export GOPROXY=file://${passthru.boringssl-go-modules}
export GOSUMDB=off
# Need to get value of $out for this flag
configureFlagsArray+=("--with-libnssckbi=$out/lib")
'';
postInstall = ''
# Remove vestigial *-config script
rm $out/bin/curl-impersonate-config
# Patch all shebangs of installed scripts
patchShebangs $out/bin
# Install headers
make -C curl-*/include install
''
+ lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) ''
# Patch completion names
substituteInPlace curl-*/scripts/Makefile \
--replace-fail "_curl" "_curl-impersonate" \
--replace-fail "curl.fish" "curl-impersonate.fish"
# Install completions
make -C curl-*/scripts install
'';
preFixup =
let
libext = stdenv.hostPlatform.extensions.sharedLibrary;
in
''
# If libnssckbi.so is needed, link libnssckbi.so without needing nss in closure
if grep -F nssckbi $out/lib/libcurl-impersonate${libext} &>/dev/null; then
ln -s ${p11-kit}/lib/pkcs11/p11-kit-trust${libext} $out/lib/libnssckbi${libext}
${lib.optionalString stdenv.hostPlatform.isElf ''
patchelf --add-needed libnssckbi${libext} $out/lib/libcurl-impersonate${libext}
''}
fi
'';
disallowedReferences = [ go ];
passthru = {
deps = callPackage ./deps.nix { };
updateScript = ./update.sh;
# Find the correct boringssl source file
boringssl-source = builtins.head (
lib.mapAttrsToList (_: file: file) (
lib.filterAttrs (name: _: lib.strings.hasPrefix "boringssl-" name) passthru.deps
)
);
boringssl-go-modules =
(buildGoModule {
inherit (passthru.boringssl-source) name;
src = passthru.boringssl-source;
vendorHash = "sha256-HepiJhj7OsV7iQHlM2yi5BITyAM04QqWRX28Rj7sRKk=";
nativeBuildInputs = [ unzip ];
proxyVendor = true;
}).goModules;
};
meta = {
description = "Special build of curl that can impersonate Chrome & Firefox";
homepage = "https://github.com/lexiforest/curl-impersonate";
license = with lib.licenses; [
curl
mit
];
maintainers = with lib.maintainers; [ ggg ];
platforms = lib.platforms.unix;
mainProgram = "curl-impersonate";
};
}

View File

@@ -0,0 +1,34 @@
# Generated by update.sh
{ fetchurl }:
{
"curl-8_15_0.tar.gz" = fetchurl {
url = "https://github.com/curl/curl/archive/curl-8_15_0.tar.gz";
hash = "sha256-KTfK3eAHqjpSoXwhrJFT6gVHAPN5JtHZZgK/B+iIyEc=";
};
"brotli-1.1.0.tar.gz" = fetchurl {
url = "https://github.com/google/brotli/archive/refs/tags/v1.1.0.tar.gz";
hash = "sha256-5yCmyilCi4A/StFlNxdx9TmPq6OX7fZ3iDehhZnqE/8=";
};
"boringssl-673e61fc215b178a90c0e67858bbf162c8158993.zip" = fetchurl {
url = "https://github.com/google/boringssl/archive/673e61fc215b178a90c0e67858bbf162c8158993.zip";
hash = "sha256-7bfWHo3j95EHAXJyPuQfvFUPtVCAzbGHu0oF5g4FmiI=";
};
"nghttp2-1.63.0.tar.bz2" = fetchurl {
url = "https://github.com/nghttp2/nghttp2/releases/download/v1.63.0/nghttp2-1.63.0.tar.bz2";
hash = "sha256-YHsXRVTSKoKLxTLR1zT+D3KbXV7SB/LxLpamLoPynFU=";
};
"ngtcp2-1.11.0.tar.bz2" = fetchurl {
url = "https://github.com/ngtcp2/ngtcp2/releases/download/v1.11.0/ngtcp2-1.11.0.tar.bz2";
hash = "sha256-122s6G/Docj84codTLsf3pu6k81fKGEdVbypukPjF7w=";
};
"nghttp3-1.9.0.tar.bz2" = fetchurl {
url = "https://github.com/ngtcp2/nghttp3/releases/download/v1.9.0/nghttp3-1.9.0.tar.bz2";
hash = "sha256-TTCmjxfnKhOStghdr6qfxzLaHX0m7sVUuyFnCDMvzxo=";
};
}

View File

@@ -0,0 +1,112 @@
#!/usr/bin/env nix-shell
#!nix-shell -i bash -p git nix jq coreutils gnugrep gnused curl common-updater-scripts
# shellcheck shell=bash
set -euo pipefail
nixpkgs="$(git rev-parse --show-toplevel || (printf 'Could not find root of nixpkgs repo\nAre we running from within the nixpkgs git repo?\n' >&2; exit 1))"
stripwhitespace() {
sed -e 's/^[[:space:]]*//' -e 's/[[:space:]]*$//'
}
narhash() {
nix --extra-experimental-features nix-command store prefetch-file --json "$1" | jq -r .hash
}
nixeval() {
nix --extra-experimental-features nix-command eval --json --impure -f "$nixpkgs" "$1" | jq -r .
}
vendorhash() {
(nix --extra-experimental-features nix-command build --no-link -f "$nixpkgs" --no-link "$1" 2>&1 >/dev/null | tail -n3 | grep -F got: | cut -d: -f2- | stripwhitespace) 2>/dev/null || true
}
findpath() {
path="$(nix --extra-experimental-features nix-command eval --json --impure -f "$nixpkgs" "$1.meta.position" | jq -r . | cut -d: -f1)"
outpath="$(nix --extra-experimental-features nix-command eval --json --impure --expr "fetchGit \"$nixpkgs\"")"
if [ -n "$outpath" ]; then
path="${path/$(echo "$outpath" | jq -r .)/$nixpkgs}"
fi
echo "$path"
}
getvar() {
echo "$2" | grep -F "$1 " | sed -e 's/:=/:/g' | cut -d: -f2- | stripwhitespace
}
evalvar() {
local out="$(getvar "$1" "$2")"
# Replace $(VAR) within variables with other variables
while [[ "$out" =~ (\$\(([A-Za-z_][A-Za-z0-9_]*)\)) ]]; do
local match="${BASH_REMATCH[1]}"
local var="${BASH_REMATCH[2]}"
local value="$(getvar "$var" "$2")"
out="${out//$match/$value}"
done
echo $out
}
attr="${UPDATE_NIX_ATTR_PATH:-curl-impersonate-chrome}"
version="$(curl -sSL "https://api.github.com/repos/lexiforest/curl-impersonate/releases/latest" | jq -r .tag_name | sed -e 's/^v//')"
pkgpath="$(findpath "$attr")"
updated="$(cd "$nixpkgs" && update-source-version "$attr" "$version" --file="$pkgpath" --print-changes | jq -r length)"
if [ "$updated" -eq 0 ]; then
echo 'update.sh: Package version not updated, nothing to do.'
exit 0
fi
vars="$(curl -sSL "https://github.com/lexiforest/curl-impersonate/raw/v$version/Makefile.in" | grep '^ *[^ ]*_\(VERSION\|URL\|COMMIT\) *:=')"
# TODO: Fix hash for curl.
cat >"$(dirname "$pkgpath")"/deps.nix <<EOF
# Generated by update.sh
{ fetchurl }:
{
"$(getvar CURL_VERSION "$vars").tar.gz" = fetchurl {
url = "https://github.com/curl/curl/archive/$(getvar CURL_VERSION "$vars").tar.gz";
hash = "$(narhash "https://github.com/curl/curl/archive/$(getvar CURL_VERSION "$vars").tar.gz")";
};
"brotli-$(getvar BROTLI_VERSION "$vars").tar.gz" = fetchurl {
url = "https://github.com/google/brotli/archive/refs/tags/v$(getvar BROTLI_VERSION "$vars").tar.gz";
hash = "$(narhash "https://github.com/google/brotli/archive/refs/tags/v$(getvar BROTLI_VERSION "$vars").tar.gz")";
};
"boringssl-$(getvar BORING_SSL_COMMIT "$vars").zip" = fetchurl {
url = "https://github.com/google/boringssl/archive/$(getvar BORING_SSL_COMMIT "$vars").zip";
hash = "$(narhash "https://github.com/google/boringssl/archive/$(getvar BORING_SSL_COMMIT "$vars").zip")";
};
"nghttp2-$(getvar NGHTTP2_VERSION "$vars").tar.bz2" = fetchurl {
url = "$(evalvar NGHTTP2_URL "$vars")";
hash = "$(narhash "$(evalvar NGHTTP2_URL "$vars")")";
};
"ngtcp2-$(getvar NGTCP2_VERSION "$vars").tar.bz2" = fetchurl {
url = "$(evalvar NGTCP2_URL "$vars")";
hash = "$(narhash "$(evalvar NGTCP2_URL "$vars")")";
};
"nghttp3-$(getvar NGHTTP3_VERSION "$vars").tar.bz2" = fetchurl {
url = "$(evalvar NGHTTP3_URL "$vars")";
hash = "$(narhash "$(evalvar NGHTTP3_URL "$vars")")";
};
}
EOF
curhash="$(nixeval "$attr.boringssl-go-modules.outputHash")"
newhash="$(vendorhash "$attr.boringssl-go-modules")"
if [ -n "$newhash" ] && [ "$curhash" != "$newhash" ]; then
sed -i -e "s|\"$curhash\"|\"$newhash\"|" "$pkgpath"
else
echo 'update.sh: New vendorHash same as old vendorHash, nothing to do.'
fi

View File

@@ -0,0 +1,13 @@
diff --git a/Makefile.in b/Makefile.in
index 877c54f..3e39ed1 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -209,6 +209,8 @@ $(NSS_VERSION).tar.gz:
$(nss_static_libs): $(NSS_VERSION).tar.gz
tar xf $(NSS_VERSION).tar.gz
+ sed -i -e "1s@#!/usr/bin/env bash@#!$$(type -p bash)@" $(NSS_VERSION)/nss/build.sh
+ sed -i -e "s@/usr/bin/\(env \)\?grep@$$(type -p grep)@" $(NSS_VERSION)/nss/coreconf/config.gypi
ifeq ($(host),$(build))
# Native build, use NSS' build script.

View File

@@ -0,0 +1,197 @@
{
lib,
stdenv,
fetchFromGitHub,
fetchpatch,
callPackage,
buildGoModule,
installShellFiles,
buildPackages,
zlib,
sqlite,
cmake,
python3,
ninja,
perl,
autoconf,
automake,
libtool,
cctools,
cacert,
unzip,
go,
p11-kit,
}:
stdenv.mkDerivation rec {
pname = "curl-impersonate-ff";
version = "0.6.1";
outputs = [
"out"
"dev"
];
src = fetchFromGitHub {
owner = "lwthiker";
repo = "curl-impersonate";
rev = "v${version}";
hash = "sha256-ExmEhjJC8FPzx08RuKOhRxKgJ4Dh+ElEl+OUHzRCzZc=";
};
patches = [
# Fix shebangs and commands in the NSS build scripts
# (can't just patchShebangs or substituteInPlace since makefile unpacks it)
./curl-impersonate-0.6.1-fix-command-paths.patch
# SOCKS5 heap buffer overflow - https://curl.se/docs/CVE-2023-38545.html
(fetchpatch {
name = "curl-impersonate-patch-cve-2023-38545.patch";
url = "https://github.com/lwthiker/curl-impersonate/commit/e7b90a0d9c61b6954aca27d346750240e8b6644e.diff";
hash = "sha256-jFrz4Q+MJGfNmwwzHhThado4c9hTd/+b/bfRsr3FW5k=";
})
];
# Disable blanket -Werror to fix build on `gcc-13` related to minor
# warnings on `boringssl`.
env.NIX_CFLAGS_COMPILE = "-Wno-error";
strictDeps = true;
depsBuildBuild = lib.optionals (stdenv.buildPlatform != stdenv.hostPlatform) [
buildPackages.stdenv.cc
];
nativeBuildInputs =
lib.optionals stdenv.hostPlatform.isDarwin [
# Must come first so that it shadows the 'libtool' command but leaves 'libtoolize'
cctools
]
++ [
installShellFiles
cmake
python3
python3.pythonOnBuildForHost.pkgs.gyp
ninja
perl
autoconf
automake
libtool
unzip
go
];
buildInputs = [
zlib
sqlite
];
configureFlags = [
"--with-ca-bundle=${
if stdenv.hostPlatform.isDarwin then "/etc/ssl/cert.pem" else "/etc/ssl/certs/ca-certificates.crt"
}"
"--with-ca-path=${cacert}/etc/ssl/certs"
];
buildFlags = [ "firefox-build" ];
checkTarget = "firefox-checkbuild";
installTargets = [ "firefox-install" ];
doCheck = true;
dontUseCmakeConfigure = true;
dontUseNinjaBuild = true;
dontUseNinjaInstall = true;
dontUseNinjaCheck = true;
postUnpack = lib.concatStringsSep "\n" (
lib.mapAttrsToList (name: dep: "ln -sT ${dep.outPath} ${src.name}/${name}") (
lib.filterAttrs (n: v: v ? outPath) passthru.deps
)
);
preConfigure = ''
export GOCACHE=$TMPDIR/go-cache
export GOPATH=$TMPDIR/go
export GOPROXY=file://${passthru.boringssl-go-modules}
export GOSUMDB=off
# Need to get value of $out for this flag
configureFlagsArray+=("--with-libnssckbi=$out/lib")
'';
postInstall = ''
# Remove vestigial *-config script
rm $out/bin/curl-impersonate-ff-config
# Patch all shebangs of installed scripts
patchShebangs $out/bin
# Install headers
make -C curl-*/include install
''
+ lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) ''
# Build and install completions for each curl binary
# Patch in correct binary name and alias it to all scripts
perl curl-*/scripts/completion.pl --curl $out/bin/curl-impersonate-ff --shell zsh >$TMPDIR/curl-impersonate-ff.zsh
substituteInPlace $TMPDIR/curl-impersonate-ff.zsh \
--replace-fail \
'#compdef curl' \
"#compdef curl-impersonate-ff$(find $out/bin -name 'curl_*' -printf ' %f=curl-impersonate-ff')"
perl curl-*/scripts/completion.pl --curl $out/bin/curl-impersonate-ff --shell fish >$TMPDIR/curl-impersonate-ff.fish
substituteInPlace $TMPDIR/curl-impersonate-ff.fish \
--replace-fail \
'--command curl' \
"--command curl-impersonate-ff$(find $out/bin -name 'curl_*' -printf ' --command %f')"
# Install zsh and fish completions
installShellCompletion $TMPDIR/curl-impersonate-ff.{zsh,fish}
'';
preFixup =
let
libext = stdenv.hostPlatform.extensions.sharedLibrary;
in
''
# If libnssckbi.so is needed, link libnssckbi.so without needing nss in closure
if grep -F nssckbi $out/lib/libcurl-impersonate-*${libext} &>/dev/null; then
ln -s ${p11-kit}/lib/pkcs11/p11-kit-trust${libext} $out/lib/libnssckbi${libext}
${lib.optionalString stdenv.hostPlatform.isElf ''
patchelf --add-needed libnssckbi${libext} $out/lib/libcurl-impersonate-*${libext}
''}
fi
'';
disallowedReferences = [ go ];
passthru = {
deps = callPackage ./deps.nix { };
updateScript = ./update.sh;
boringssl-go-modules =
(buildGoModule {
inherit (passthru.deps."boringssl.zip") name;
src = passthru.deps."boringssl.zip";
vendorHash = "sha256-SNUsBiKOGWmkRdTVABVrlbLAVMfu0Q9IgDe+kFC5vXs=";
nativeBuildInputs = [ unzip ];
proxyVendor = true;
}).goModules;
};
meta = with lib; {
description = "Special build of curl that can impersonate Chrome & Firefox";
homepage = "https://github.com/lwthiker/curl-impersonate";
license = with licenses; [
curl
mit
];
maintainers = with maintainers; [ deliciouslytyped ];
platforms = platforms.unix;
mainProgram = "curl-impersonate-ff";
};
}

View File

@@ -0,0 +1,28 @@
# Generated by update.sh
{ fetchurl }:
{
"curl-8.1.1.tar.xz" = fetchurl {
url = "https://curl.se/download/curl-8.1.1.tar.xz";
hash = "sha256-CKlI4GGSlkVZfB73GU4HswiyIIT/A/p0ALRl5sBRSeU=";
};
"brotli-1.0.9.tar.gz" = fetchurl {
url = "https://github.com/google/brotli/archive/refs/tags/v1.0.9.tar.gz";
hash = "sha256-+ejYHQQFumbRgVKa9CozVPg4yTkJX/mZMNpqqc32/kY=";
};
"nss-3.92.tar.gz" = fetchurl {
url = "https://ftp.mozilla.org/pub/security/nss/releases/NSS_3_92_RTM/src/nss-3.92-with-nspr-4.35.tar.gz";
hash = "sha256-IcF2v/+27IQLX5hcf48BRoL0ovtVsGkkc0Fy1cBIbcU=";
};
"boringssl.zip" = fetchurl {
url = "https://github.com/google/boringssl/archive/1b7fdbd9101dedc3e0aa3fcf4ff74eacddb34ecc.zip";
hash = "sha256-daVVQvpxkuEL/8/+QtLOJkdO+ECYZE3P4qJmDjV1GM0=";
};
"nghttp2-1.56.0.tar.bz2" = fetchurl {
url = "https://github.com/nghttp2/nghttp2/releases/download/v1.56.0/nghttp2-1.56.0.tar.bz2";
hash = "sha256-L13Nv1d6LfUTokZGRUhMw10uTQczZT1jGTrlHbQd70E=";
};
}

View File

@@ -0,0 +1,92 @@
#!/usr/bin/env nix-shell
#!nix-shell -i bash -p git nix jq coreutils gnugrep gnused curl common-updater-scripts
# shellcheck shell=bash
set -euo pipefail
nixpkgs="$(git rev-parse --show-toplevel || (printf 'Could not find root of nixpkgs repo\nAre we running from within the nixpkgs git repo?\n' >&2; exit 1))"
stripwhitespace() {
sed -e 's/^[[:space:]]*//' -e 's/[[:space:]]*$//'
}
narhash() {
nix --extra-experimental-features nix-command store prefetch-file --json "$1" | jq -r .hash
}
nixeval() {
nix --extra-experimental-features nix-command eval --json --impure -f "$nixpkgs" "$1" | jq -r .
}
vendorhash() {
(nix --extra-experimental-features nix-command build --no-link -f "$nixpkgs" --no-link "$1" 2>&1 >/dev/null | tail -n3 | grep -F got: | cut -d: -f2- | stripwhitespace) 2>/dev/null || true
}
findpath() {
path="$(nix --extra-experimental-features nix-command eval --json --impure -f "$nixpkgs" "$1.meta.position" | jq -r . | cut -d: -f1)"
outpath="$(nix --extra-experimental-features nix-command eval --json --impure --expr "fetchGit \"$nixpkgs\"")"
if [ -n "$outpath" ]; then
path="${path/$(echo "$outpath" | jq -r .)/$nixpkgs}"
fi
echo "$path"
}
getvar() {
echo "$2" | grep -F "$1" | sed -e 's/:=/:/g' | cut -d: -f2- | stripwhitespace
}
attr="${UPDATE_NIX_ATTR_PATH:-curl-impersonate}"
version="$(curl -sSL "https://api.github.com/repos/lwthiker/curl-impersonate/releases/latest" | jq -r .tag_name | sed -e 's/^v//')"
pkgpath="$(findpath "$attr")"
updated="$(cd "$nixpkgs" && update-source-version "$attr" "$version" --file="$pkgpath" --print-changes | jq -r length)"
if [ "$updated" -eq 0 ]; then
echo 'update.sh: Package version not updated, nothing to do.'
exit 0
fi
vars="$(curl -sSL "https://github.com/lwthiker/curl-impersonate/raw/v$version/Makefile.in" | grep '^ *[^ ]*_\(VERSION\|URL\|COMMIT\) *:=')"
cat >"$(dirname "$pkgpath")"/deps.nix <<EOF
# Generated by update.sh
{ fetchurl }:
{
"$(getvar CURL_VERSION "$vars").tar.xz" = fetchurl {
url = "https://curl.se/download/$(getvar CURL_VERSION "$vars").tar.xz";
hash = "$(narhash "https://curl.se/download/$(getvar CURL_VERSION "$vars").tar.xz")";
};
"brotli-$(getvar BROTLI_VERSION "$vars").tar.gz" = fetchurl {
url = "https://github.com/google/brotli/archive/refs/tags/v$(getvar BROTLI_VERSION "$vars").tar.gz";
hash = "$(narhash "https://github.com/google/brotli/archive/refs/tags/v$(getvar BROTLI_VERSION "$vars").tar.gz")";
};
"$(getvar NSS_VERSION "$vars").tar.gz" = fetchurl {
url = "$(getvar NSS_URL "$vars")";
hash = "$(narhash "$(getvar NSS_URL "$vars")")";
};
"boringssl.zip" = fetchurl {
url = "https://github.com/google/boringssl/archive/$(getvar BORING_SSL_COMMIT "$vars").zip";
hash = "$(narhash "https://github.com/google/boringssl/archive/$(getvar BORING_SSL_COMMIT "$vars").zip")";
};
"$(getvar NGHTTP2_VERSION "$vars").tar.bz2" = fetchurl {
url = "$(getvar NGHTTP2_URL "$vars")";
hash = "$(narhash "$(getvar NGHTTP2_URL "$vars")")";
};
}
EOF
curhash="$(nixeval "$attr.curl-impersonate-chrome.boringssl-go-modules.outputHash")"
newhash="$(vendorhash "$attr.curl-impersonate-chrome.boringssl-go-modules")"
if [ -n "$newhash" ] && [ "$curhash" != "$newhash" ]; then
sed -i -e "s|\"$curhash\"|\"$newhash\"|" "$pkgpath"
else
echo 'update.sh: New vendorHash same as old vendorHash, nothing to do.'
fi

View File

@@ -0,0 +1,25 @@
{
symlinkJoin,
callPackage,
nixosTests,
}:
symlinkJoin rec {
pname = "curl-impersonate";
inherit (passthru.curl-impersonate-chrome) version meta;
name = "${pname}-${version}";
paths = [
passthru.curl-impersonate-ff
passthru.curl-impersonate-chrome
];
passthru = {
curl-impersonate-ff = callPackage ./firefox { };
curl-impersonate-chrome = callPackage ./chrome { };
inherit (passthru.curl-impersonate-chrome) src;
tests = { inherit (nixosTests) curl-impersonate; };
};
}

View File

@@ -0,0 +1,293 @@
{
lib,
stdenv,
fetchurl,
pkg-config,
perl,
nixosTests,
autoreconfHook,
brotliSupport ? false,
brotli,
c-aresSupport ? false,
c-aresMinimal,
gnutlsSupport ? false,
gnutls,
gsaslSupport ? false,
gsasl,
gssSupport ?
with stdenv.hostPlatform;
(
!isWindows
&&
# disable gss because of: undefined reference to `k5_bcmp'
# a very sad story re static: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=439039
!isStatic
&&
# the "mig" tool does not configure its compiler correctly. This could be
# fixed in mig, but losing gss support on cross compilation to darwin is
# not worth the effort.
!(isDarwin && (stdenv.buildPlatform != stdenv.hostPlatform))
),
libkrb5,
http2Support ? true,
nghttp2,
http3Support ? false,
nghttp3,
ngtcp2,
websocketSupport ? false,
idnSupport ? false,
libidn2,
ldapSupport ? false,
openldap,
opensslSupport ? zlibSupport,
openssl,
pslSupport ? false,
libpsl,
rtmpSupport ? false,
rtmpdump,
scpSupport ? zlibSupport && !stdenv.hostPlatform.isSunOS && !stdenv.hostPlatform.isCygwin,
libssh2,
wolfsslSupport ? false,
wolfssl,
rustlsSupport ? false,
rustls-ffi,
zlibSupport ? true,
zlib,
zstdSupport ? false,
zstd,
# for passthru.tests
coeurl,
curlpp,
haskellPackages,
ocamlPackages,
phpExtensions,
pkgsStatic,
python3,
tests,
testers,
fetchpatch,
}:
# Note: this package is used for bootstrapping fetchurl, and thus
# cannot use fetchpatch! All mutable patches (generated by GitHub or
# cgit) that are needed here should be included directly in Nixpkgs as
# files.
assert
!(
(lib.count (x: x) [
gnutlsSupport
opensslSupport
wolfsslSupport
rustlsSupport
]) > 1
);
stdenv.mkDerivation (finalAttrs: {
pname = "curl";
version = "8.16.0";
src = fetchurl {
urls = [
"https://curl.haxx.se/download/curl-${finalAttrs.version}.tar.xz"
"https://github.com/curl/curl/releases/download/curl-${
builtins.replaceStrings [ "." ] [ "_" ] finalAttrs.version
}/curl-${finalAttrs.version}.tar.xz"
];
hash = "sha256-QMjN28tsxiUcA96kI6Ryps6kA3vmVLpc9d7G6y0i/x0=";
};
# this could be accomplished by updateAutotoolsGnuConfigScriptsHook, but that causes infinite recursion
# necessary for FreeBSD code path in configure
postPatch = ''
substituteInPlace ./config.guess --replace-fail /usr/bin/uname uname
patchShebangs scripts
'';
outputs = [
"bin"
"dev"
"out"
"man"
"devdoc"
];
separateDebugInfo = stdenv.hostPlatform.isLinux;
enableParallelBuilding = true;
strictDeps = true;
env = lib.optionalAttrs (stdenv.hostPlatform.isDarwin && stdenv.hostPlatform.isStatic) {
# Not having this causes curls `configure` script to fail with static builds on Darwin because
# some of curls propagated inputs need libiconv.
NIX_LDFLAGS = "-liconv";
};
nativeBuildInputs = [
pkg-config
perl
]
++ lib.optionals stdenv.hostPlatform.isOpenBSD [ autoreconfHook ];
nativeCheckInputs = [
# See https://github.com/curl/curl/pull/16928
openssl
];
# Zlib and OpenSSL must be propagated because `libcurl.la' contains
# "-lz -lssl", which aren't necessary direct build inputs of
# applications that use Curl.
propagatedBuildInputs =
lib.optional brotliSupport brotli
++ lib.optional c-aresSupport c-aresMinimal
++ lib.optional gnutlsSupport gnutls
++ lib.optional gsaslSupport gsasl
++ lib.optional gssSupport libkrb5
++ lib.optional http2Support nghttp2
++ lib.optionals http3Support [
nghttp3
ngtcp2
]
++ lib.optional idnSupport libidn2
++ lib.optional ldapSupport openldap
++ lib.optional opensslSupport openssl
++ lib.optional pslSupport libpsl
++ lib.optional rtmpSupport rtmpdump
++ lib.optional scpSupport libssh2
++ lib.optional wolfsslSupport wolfssl
++ lib.optional rustlsSupport rustls-ffi
++ lib.optional zlibSupport zlib
++ lib.optional zstdSupport zstd;
# for the second line see https://curl.haxx.se/mail/tracker-2014-03/0087.html
preConfigure = ''
sed -e 's|/usr/bin|/no-such-path|g' -i.bak configure
rm src/tool_hugehelp.c
'';
configureFlags = [
"--enable-versioned-symbols"
# Build without manual
"--disable-manual"
(lib.enableFeature c-aresSupport "ares")
(lib.enableFeature ldapSupport "ldap")
(lib.enableFeature ldapSupport "ldaps")
(lib.enableFeature websocketSupport "websockets")
# --with-ca-fallback is only supported for openssl https://github.com/curl/curl/blame/curl-8_16_0/acinclude.m4#L1258
(lib.withFeature opensslSupport "ca-fallback")
(lib.withFeature http3Support "nghttp3")
(lib.withFeature http3Support "ngtcp2")
(lib.withFeature rtmpSupport "librtmp")
(lib.withFeature rustlsSupport "rustls")
(lib.withFeature zstdSupport "zstd")
(lib.withFeature pslSupport "libpsl")
(lib.withFeatureAs brotliSupport "brotli" (lib.getDev brotli))
(lib.withFeatureAs gnutlsSupport "gnutls" (lib.getDev gnutls))
(lib.withFeatureAs idnSupport "libidn2" (lib.getDev libidn2))
(lib.withFeatureAs opensslSupport "openssl" (lib.getDev openssl))
(lib.withFeatureAs scpSupport "libssh2" (lib.getDev libssh2))
(lib.withFeatureAs wolfsslSupport "wolfssl" (lib.getDev wolfssl))
]
++ lib.optional gssSupport "--with-gssapi=${lib.getDev libkrb5}"
# For the 'urandom', maybe it should be a cross-system option
++ lib.optional (stdenv.hostPlatform != stdenv.buildPlatform) "--with-random=/dev/urandom"
++ lib.optionals stdenv.hostPlatform.isDarwin [
# Disable default CA bundle, use NIX_SSL_CERT_FILE or fallback to nss-cacert from the default profile.
# Without this curl might detect /etc/ssl/cert.pem at build time on macOS, causing curl to ignore NIX_SSL_CERT_FILE.
"--without-ca-bundle"
"--without-ca-path"
]
++ lib.optionals (!gnutlsSupport && !opensslSupport && !wolfsslSupport && !rustlsSupport) [
"--without-ssl"
]
++ lib.optionals (rustlsSupport && !stdenv.hostPlatform.isDarwin) [
"--with-ca-bundle=/etc/ssl/certs/ca-certificates.crt"
]
++ lib.optionals (gnutlsSupport && !stdenv.hostPlatform.isDarwin) [
"--with-ca-path=/etc/ssl/certs"
];
CXX = "${stdenv.cc.targetPrefix}c++";
CXXCPP = "${stdenv.cc.targetPrefix}c++ -E";
# takes 14 minutes on a 24 core and because many other packages depend on curl
# they cannot be run concurrently and are a bottleneck
# tests are available in passthru.tests.withCheck
doCheck = false;
preCheck = ''
patchShebangs tests/
''
+ lib.optionalString stdenv.hostPlatform.isDarwin ''
# bad interaction with sandbox if enabled?
rm tests/data/test1453
rm tests/data/test1086
''
+ lib.optionalString stdenv.hostPlatform.isMusl ''
# different resolving behaviour?
rm tests/data/test1592
'';
__darwinAllowLocalNetworking = true;
postInstall = ''
moveToOutput bin/curl-config "$dev"
# Install completions
make -C scripts install
''
+ lib.optionalString scpSupport ''
sed '/^dependency_libs/s|${lib.getDev libssh2}|${lib.getLib libssh2}|' -i "$out"/lib/*.la
''
+ lib.optionalString gnutlsSupport ''
ln $out/lib/libcurl${stdenv.hostPlatform.extensions.sharedLibrary} $out/lib/libcurl-gnutls${stdenv.hostPlatform.extensions.sharedLibrary}
ln $out/lib/libcurl${stdenv.hostPlatform.extensions.sharedLibrary} $out/lib/libcurl-gnutls${stdenv.hostPlatform.extensions.sharedLibrary}.4
ln $out/lib/libcurl${stdenv.hostPlatform.extensions.sharedLibrary} $out/lib/libcurl-gnutls${stdenv.hostPlatform.extensions.sharedLibrary}.4.4.0
'';
passthru =
let
useThisCurl = attr: attr.override { curl = finalAttrs.finalPackage; };
in
{
inherit opensslSupport openssl;
tests = {
withCheck = finalAttrs.finalPackage.overrideAttrs (_: {
doCheck = true;
});
fetchpatch = tests.fetchpatch.simple.override {
fetchpatch = (fetchpatch.override { fetchurl = useThisCurl fetchurl; }) // {
version = 1;
};
};
curlpp = useThisCurl curlpp;
coeurl = useThisCurl coeurl;
haskell-curl = useThisCurl haskellPackages.curl;
ocaml-curly = useThisCurl ocamlPackages.curly;
pycurl = useThisCurl python3.pkgs.pycurl;
php-curl = useThisCurl phpExtensions.curl;
# error: attribute 'override' missing
# Additional checking with support http3 protocol.
# nginx-http3 = useThisCurl nixosTests.nginx-http3;
nginx-http3 = nixosTests.nginx-http3;
pkg-config = testers.testMetaPkgConfig finalAttrs.finalPackage;
static = pkgsStatic.curl;
};
};
meta = {
changelog = "https://curl.se/ch/${finalAttrs.version}.html";
description = "Command line tool for transferring files with URL syntax";
homepage = "https://curl.se/";
license = lib.licenses.curl;
maintainers = with lib.maintainers; [
lovek323
Scrumplex
];
platforms = lib.platforms.all;
# Fails to link against static brotli or gss
broken = stdenv.hostPlatform.isStatic && (brotliSupport || gssSupport);
pkgConfigModules = [ "libcurl" ];
mainProgram = "curl";
};
})

View File

@@ -0,0 +1,13 @@
diff -Naur a/configure.ac b/configure.ac
--- a/configure.ac 2008-04-23 20:37:42.000000000 +0900
+++ b/configure.ac 2021-05-16 01:28:24.000000000 +0900
@@ -46,9 +46,7 @@
# Checks for library functions.
AC_FUNC_CHOWN
-AC_FUNC_MALLOC
AC_FUNC_MKTIME
-AC_FUNC_REALLOC
AC_FUNC_SELECT_ARGTYPES
AC_FUNC_STRFTIME
AC_FUNC_UTIME_NULL

View File

@@ -0,0 +1,61 @@
{
lib,
stdenv,
fetchurl,
autoreconfHook,
fuse,
curl,
pkg-config,
glib,
zlib,
}:
stdenv.mkDerivation rec {
pname = "curlftpfs";
version = "0.9.2";
src = fetchurl {
url = "mirror://sourceforge/curlftpfs/curlftpfs-${version}.tar.gz";
sha256 = "0n397hmv21jsr1j7zx3m21i7ryscdhkdsyqpvvns12q7qwwlgd2f";
};
patches = [
# This removes AC_FUNC_MALLOC and AC_FUNC_REALLOC from configure.ac because
# it is known to cause problems. Search online for "rpl_malloc" and
# "rpl_realloc" to find out more.
./fix-rpl_malloc.patch
./suse-bug-580609.patch
./suse-bug-955687.patch
];
nativeBuildInputs = [
autoreconfHook
pkg-config
];
buildInputs = [
fuse
curl
glib
zlib
];
CFLAGS = lib.optionalString stdenv.hostPlatform.isDarwin "-D__off_t=off_t";
postPatch = lib.optionalString stdenv.hostPlatform.isDarwin ''
# Fix the build on macOS with macFUSE installed. Needs autoreconfHook for
# this change to effect
substituteInPlace configure.ac --replace \
'export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig:$PKG_CONFIG_PATH' \
""
'';
doCheck = false; # fails, doesn't work well too, btw
meta = with lib; {
description = "Filesystem for accessing FTP hosts based on FUSE and libcurl";
mainProgram = "curlftpfs";
homepage = "https://curlftpfs.sourceforge.net";
license = licenses.gpl2Only;
platforms = platforms.unix;
};
}

View File

@@ -0,0 +1,10 @@
--- a/ftpfs.c 2008-04-30 01:05:47.000000000 +0200
+++ b/ftpfs.c 2010-05-21 13:01:42.569006163 +0200
@@ -503,7 +503,6 @@ static void *ftpfs_write_thread(void *da
curl_easy_setopt_or_die(fh->write_conn, CURLOPT_URL, fh->full_path);
curl_easy_setopt_or_die(fh->write_conn, CURLOPT_UPLOAD, 1);
- curl_easy_setopt_or_die(fh->write_conn, CURLOPT_INFILESIZE, -1);
curl_easy_setopt_or_die(fh->write_conn, CURLOPT_READFUNCTION, write_data_bg);
curl_easy_setopt_or_die(fh->write_conn, CURLOPT_READDATA, fh);
curl_easy_setopt_or_die(fh->write_conn, CURLOPT_LOW_SPEED_LIMIT, 1);

View File

@@ -0,0 +1,11 @@
--- a/ftpfs.c
+++ b/ftpfs.c
@@ -614,6 +614,8 @@ static void free_ftpfs_file(struct ftpfs
sem_destroy(&fh->data_need);
sem_destroy(&fh->data_written);
sem_destroy(&fh->ready);
+ if (fh->buf.size) { buf_free(&fh->buf); }
+ if (fh->stream_buf.size) { buf_free(&fh->stream_buf); }
free(fh);
}

View File

@@ -0,0 +1,40 @@
{
lib,
buildGoModule,
fetchFromGitHub,
curlie,
testers,
}:
buildGoModule (finalAttrs: {
pname = "curlie";
version = "1.8.2";
src = fetchFromGitHub {
owner = "rs";
repo = "curlie";
tag = "v${finalAttrs.version}";
hash = "sha256-BlpIDik4hkU4c+KCyAmgUURIN362RDQID/qo6Ojp2Ek=";
};
vendorHash = "sha256-GBccl8V87u26dtrGpHR+rKqRBqX6lq1SBwfsPvj/+44=";
ldflags = [
"-s"
"-w"
"-X main.version=${finalAttrs.version}"
];
passthru.tests.version = testers.testVersion {
package = curlie;
command = "curlie version";
};
meta = {
description = "Frontend to curl that adds the ease of use of httpie, without compromising on features and performance";
homepage = "https://rs.github.io/curlie/";
maintainers = with lib.maintainers; [ ma27 ];
license = lib.licenses.mit;
mainProgram = "curlie";
};
})

View File

@@ -0,0 +1,25 @@
diff --git a/doc/guide.tex b/doc/guide.tex
index 12165e7..76b5c59 100644
--- a/doc/guide.tex
+++ b/doc/guide.tex
@@ -623,8 +623,6 @@ see the ``how to enhance cURLpp'' section.
cURL::CURLOPT_LOW_SPEED_TIME > LowSpeedTime;
typedef cURLpp::OptionTrait< long,
cURL::CURLOPT_MAXCONNECTS > MaxConnects;
- typedef cURLpp::OptionTrait< cURL::curl_closepolicy,
- cURL::CURLOPT_CLOSEPOLICY > ClosePolicy;
typedef cURLpp::OptionTrait< bool,
cURL::CURLOPT_FRESH_CONNECT > FreshConnect;
typedef cURLpp::OptionTrait< bool,
diff --git a/include/curlpp/Options.hpp b/include/curlpp/Options.hpp
index c705c9d..ca6fec6 100644
--- a/include/curlpp/Options.hpp
+++ b/include/curlpp/Options.hpp
@@ -278,7 +278,6 @@ namespace options
typedef curlpp::OptionTrait<long, CURLOPT_LOW_SPEED_LIMIT> LowSpeedLimit;
typedef curlpp::OptionTrait<long, CURLOPT_LOW_SPEED_TIME> LowSpeedTime;
typedef curlpp::OptionTrait<long, CURLOPT_MAXCONNECTS> MaxConnects;
- typedef curlpp::OptionTrait<curl_closepolicy, CURLOPT_CLOSEPOLICY> ClosePolicy;
typedef curlpp::OptionTrait<bool, CURLOPT_FRESH_CONNECT> FreshConnect;
typedef curlpp::OptionTrait<bool, CURLOPT_FORBID_REUSE> ForbidReuse;
typedef curlpp::OptionTrait<long, CURLOPT_CONNECTTIMEOUT> ConnectTimeout;

View File

@@ -0,0 +1,34 @@
{
lib,
stdenv,
fetchFromGitHub,
cmake,
curl,
}:
stdenv.mkDerivation rec {
pname = "curlpp";
version = "0.8.1";
src = fetchFromGitHub {
owner = "jpbarrette";
repo = "curlpp";
rev = "v${version}";
sha256 = "1b0ylnnrhdax4kwjq64r1fk0i24n5ss6zfzf4hxwgslny01xiwrk";
};
patches = [
# https://github.com/jpbarrette/curlpp/pull/171
./curl_8_10_build_failure.patch
];
buildInputs = [ curl ];
nativeBuildInputs = [ cmake ];
meta = with lib; {
homepage = "https://www.curlpp.org/";
description = "C++ wrapper around libcURL";
mainProgram = "curlpp-config";
license = licenses.mit;
maintainers = with maintainers; [ CrazedProgrammer ];
};
}

View File

@@ -0,0 +1,11 @@
--- a/curseradio/curseradio.py
+++ b/curseradio/curseradio.py
@@ -30,7 +30,7 @@ import re
CONFIG_DEFAULT = {
'opml': {'root': "http://opml.radiotime.com/"},
- 'playback': {'command': '/usr/bin/mpv'},
+ 'playback': {'command': '@mpv@/bin/mpv'},
'interface': {'keymap': 'default'},
'keymap.default': {
'up': 'KEY_UP',

View File

@@ -0,0 +1,47 @@
{
lib,
fetchFromGitHub,
replaceVars,
python3Packages,
mpv,
}:
python3Packages.buildPythonApplication {
version = "0.2";
format = "pyproject";
pname = "curseradio";
src = fetchFromGitHub {
owner = "chronitis";
repo = "curseradio";
rev = "1bd4bd0faeec675e0647bac9a100b526cba19f8d";
sha256 = "11bf0jnj8h2fxhpdp498189r4s6b47vy4wripv0z4nx7lxajl88i";
};
build-system = with python3Packages; [
setuptools
];
dependencies = with python3Packages; [
requests
lxml
pyxdg
];
patches = [
(replaceVars ./mpv.patch {
inherit mpv;
})
];
# No tests
doCheck = false;
meta = with lib; {
description = "Command line radio player";
mainProgram = "curseradio";
homepage = "https://github.com/chronitis/curseradio";
license = licenses.mit;
maintainers = [ maintainers.eyjhb ];
};
}

View File

@@ -0,0 +1,40 @@
{
lib,
python3Packages,
fetchFromGitHub,
}:
python3Packages.buildPythonApplication rec {
pname = "cursewords";
version = "1.1";
format = "pyproject";
src = fetchFromGitHub {
owner = "thisisparker";
repo = "cursewords";
rev = "v${version}";
hash = "sha256-Ssr15kSdWmyMFFG5uCregrpGQ3rI2cMXqY9+/a3gs84=";
};
build-system = [
python3Packages.setuptools
];
doCheck = false; # no tests
pythonRelaxDeps = [
"blessed"
];
dependencies = [
python3Packages.blessed
];
meta = with lib; {
homepage = "https://github.com/thisisparker/cursewords";
description = "Graphical command line program for solving crossword puzzles in the terminal";
mainProgram = "cursewords";
license = licenses.agpl3Only;
maintainers = [ ];
platforms = platforms.all;
};
}

View File

@@ -0,0 +1,67 @@
{
lib,
fetchurl,
stdenv,
autoPatchelfHook,
}:
let
inherit (stdenv) hostPlatform;
sources = {
x86_64-linux = fetchurl {
url = "https://downloads.cursor.com/lab/2025.10.02-bd871ac/linux/x64/agent-cli-package.tar.gz";
hash = "sha256-tqppTOkeChlyw3IjSkhGpNvMX9U5s2hiu13/RWakENg=";
};
aarch64-linux = fetchurl {
url = "https://downloads.cursor.com/lab/2025.10.02-bd871ac/linux/arm64/agent-cli-package.tar.gz";
hash = "sha256-Gf/2wLS2+xQ6Mu4u96n4hI1I4L2iIG16R668BQCNZaw=";
};
x86_64-darwin = fetchurl {
url = "https://downloads.cursor.com/lab/2025.10.02-bd871ac/darwin/x64/agent-cli-package.tar.gz";
hash = "sha256-/qznJxLpyUBH4L6zJSDB5mVFVk2Y7UJCt2Uw5g7U6AQ=";
};
aarch64-darwin = fetchurl {
url = "https://downloads.cursor.com/lab/2025.10.02-bd871ac/darwin/arm64/agent-cli-package.tar.gz";
hash = "sha256-drbaPM4ho5/1vmQWMgBelmqR7Np45w/XR0ZsfR53vZI=";
};
};
in
stdenv.mkDerivation {
pname = "cursor-cli";
version = "0-unstable-2025-10-02";
src = sources.${hostPlatform.system};
nativeBuildInputs = lib.optionals hostPlatform.isLinux [
autoPatchelfHook
stdenv.cc.cc.lib
];
installPhase = ''
runHook preInstall
mkdir -p $out/bin $out/share/cursor-agent
cp -r * $out/share/cursor-agent/
ln -s $out/share/cursor-agent/cursor-agent $out/bin/cursor-agent
runHook postInstall
'';
passthru = {
inherit sources;
updateScript = ./update.sh;
};
meta = {
description = "Cursor CLI";
homepage = "https://cursor.com/cli";
license = lib.licenses.unfree;
maintainers = with lib.maintainers; [
sudosubin
andrewbastin
];
platforms = builtins.attrNames sources;
mainProgram = "cursor-agent";
sourceProvenance = with lib.sourceTypes; [ binaryNativeCode ];
};
}

View File

@@ -0,0 +1,32 @@
#!/usr/bin/env nix-shell
#!nix-shell -i bash -p curl coreutils common-updater-scripts
set -eu -o pipefail
release=$(curl -s https://cursor.com/install | grep -oP "lab/\K[^/]+")
# Check if release matches the pattern YYYY.MM.DD-{commithash}
if [[ "$release" =~ ^[0-9]{4}\.[0-9]{2}\.[0-9]{2}-[a-f0-9]+$ ]]; then
timestamp=$(echo "$release" | cut -d"-" -f1 | tr "." "-")
latestVersion="0-unstable-$timestamp"
else
latestVersion="$release"
fi
currentVersion=$(nix eval --raw -f . cursor-cli.version)
echo "latest version: $latestVersion"
echo "current version: $currentVersion"
if [[ "$latestVersion" == "$currentVersion" ]]; then
echo "package is up-to-date"
exit 0
fi
declare -A platforms=( [x86_64-linux]="linux/x64" [aarch64-linux]="linux/arm64" [x86_64-darwin]="darwin/x64" [aarch64-darwin]="darwin/arm64" )
for platform in "${!platforms[@]}"; do
url="https://downloads.cursor.com/lab/$release/${platforms[$platform]}/agent-cli-package.tar.gz"
source=$(nix-prefetch-url "$url" --name "cursor-cli-$latestVersion")
hash=$(nix-hash --to-sri --type sha256 "$source")
update-source-version cursor-cli "$latestVersion" "$hash" "$url" --system="$platform" --source-key="sources.$platform" --ignore-same-version
done

View File

@@ -0,0 +1,91 @@
{
lib,
python3,
fetchFromGitHub,
wrapGAppsHook4,
appstream-glib,
desktop-file-utils,
gettext,
gtk4,
libadwaita,
meson,
ninja,
pkg-config,
gobject-introspection,
jpegoptim,
libwebp,
optipng,
pngquant,
oxipng,
nix-update-script,
}:
python3.pkgs.buildPythonApplication rec {
pname = "curtail";
version = "1.13.0";
format = "other";
src = fetchFromGitHub {
owner = "Huluti";
repo = "Curtail";
tag = version;
sha256 = "sha256-JfioWtd0jGTyaD5uELAqH6J+h04MOrfEqdR7GWgXyMw=";
};
nativeBuildInputs = [
wrapGAppsHook4
appstream-glib
desktop-file-utils
gettext
gtk4
libadwaita
meson
ninja
pkg-config
gobject-introspection
];
buildInputs = [
appstream-glib
gettext
gtk4
libadwaita
];
propagatedBuildInputs = [
python3.pkgs.pygobject3
];
preInstall = ''
patchShebangs ../build-aux/meson/postinstall.py
'';
dontWrapGApps = true;
preFixup = ''
makeWrapperArgs+=(
"''${gappsWrapperArgs[@]}"
"--prefix" "PATH" ":" "${
lib.makeBinPath [
jpegoptim
libwebp
optipng
pngquant
oxipng
]
}"
)
'';
passthru = {
updateScript = nix-update-script { };
};
meta = with lib; {
description = "Simple & useful image compressor";
mainProgram = "curtail";
homepage = "https://github.com/Huluti/Curtail";
license = licenses.gpl3Only;
teams = [ lib.teams.gnome-circle ];
};
}

View File

@@ -0,0 +1,84 @@
{
lib,
stdenv,
fetchFromGitea,
cmake,
git,
pkg-config,
boost,
eigen_3_4_0,
glm,
libGL,
libpng,
openexr,
onetbb,
xorg,
ilmbase,
llvmPackages,
unstableGitUpdater,
}:
stdenv.mkDerivation {
pname = "curv";
version = "0.5-unstable-2025-01-20";
src = fetchFromGitea {
domain = "codeberg.org";
owner = "doug-moen";
repo = "curv";
rev = "ef082c6612407dd8abce06015f9a16b1ebf661b8";
hash = "sha256-BGL07ZBA+ao3fg3qp56sVTe+3tM2SOp8TGu/jF7SVlM=";
fetchSubmodules = true;
};
strictDeps = true;
nativeBuildInputs = [
cmake
git
pkg-config
];
buildInputs = [
boost
eigen_3_4_0
glm
libGL
libpng
openexr
onetbb
xorg.libX11
xorg.libXcursor
xorg.libXext
xorg.libXi
xorg.libXinerama
xorg.libXrandr
]
++ lib.optionals stdenv.hostPlatform.isDarwin [
ilmbase
llvmPackages.openmp
];
# force char to be unsigned on aarch64
# https://codeberg.org/doug-moen/curv/issues/227
NIX_CFLAGS_COMPILE = [ "-fsigned-char" ];
# GPU tests do not work in sandbox, instead we do this for sanity
doInstallCheck = true;
installCheckPhase = ''
runHook preInstallCheck
test "$(set -x; $out/bin/curv -x "2 + 2")" -eq "4"
runHook postInstallCheck
'';
passthru.updateScript = unstableGitUpdater { };
meta = with lib; {
description = "2D and 3D geometric modelling programming language for creating art with maths";
homepage = "https://codeberg.org/doug-moen/curv";
license = licenses.asl20;
platforms = platforms.all;
broken = stdenv.hostPlatform.isDarwin;
maintainers = with maintainers; [ pbsds ];
mainProgram = "curv";
};
}

View File

@@ -0,0 +1,52 @@
{
lib,
stdenv,
fetchFromGitHub,
autoreconfHook,
libusb1,
sfml_2,
}:
stdenv.mkDerivation (finalAttrs: {
pname = "cutecapture";
version = "1.4.0";
src = fetchFromGitHub {
owner = "Gotos";
repo = "cutecapture";
tag = "v${finalAttrs.version}";
hash = "sha256-V8BlZykh9zOTcEypu96Ft9/6CtjsybtD8lBsg9sF5sQ=";
};
nativeBuildInputs = [
autoreconfHook
];
buildInputs = [
libusb1
sfml_2
];
postPatch = ''
cat > get_version.sh <<EOF
#!${stdenv.shell}
echo ${lib.escapeShellArg finalAttrs.version}
EOF
'';
doInstallCheck = true;
postInstall = ''
install -Dm644 -t $out/lib/udev/rules.d 95-{3,}dscapture.rules
install -Dm444 -t $out/share/applications Cute{3,}DSCapture.desktop
install -Dm444 -t $out/share/icons/hicolor/128x128/apps Cute{3,}DSCapture.png
'';
meta = {
description = "Nintendo DS and 3DS capture software for Linux and Mac";
homepage = "https://github.com/Gotos/CuteCapture";
license = lib.licenses.asl20;
platforms = lib.platforms.linux ++ lib.platforms.darwin;
maintainers = with lib.maintainers; [ raphaelr ];
};
})

View File

@@ -0,0 +1,31 @@
{
lib,
stdenv,
fetchurl,
}:
stdenv.mkDerivation rec {
pname = "cutee";
version = "0.4.2";
src = fetchurl {
url = "http://www.codesink.org/download/${pname}-${version}.tar.gz";
sha256 = "18bzvhzx8k24mpcim5669n3wg9hd0sfsxj8zjpbr24hywrlppgc2";
};
buildFlags = [ "cutee" ];
installPhase = ''
mkdir -p $out/bin
cp cutee $out/bin
'';
meta = with lib; {
description = "C++ Unit Testing Easy Environment";
mainProgram = "cutee";
homepage = "https://www.codesink.org/cutee_unit_testing.html";
license = licenses.gpl2Plus;
maintainers = with maintainers; [ leenaars ];
platforms = platforms.linux;
};
}

View File

@@ -0,0 +1,66 @@
{
stdenv,
libsForQt5,
fetchFromGitLab,
makeDesktopItem,
lib,
copyDesktopItems,
}:
let
version = "0.3.3";
in
stdenv.mkDerivation {
pname = "cutentr";
inherit version;
src = fetchFromGitLab {
owner = "BoltsJ";
repo = "cuteNTR";
tag = version;
hash = "sha256-KfnC9R38qSMhQDeaMBWm1HoO3Wzs5kyfPFwdMZCWw4E=";
};
desktopItems = lib.singleton (makeDesktopItem {
name = "cuteNTR";
desktopName = "cuteNTR";
icon = "cutentr";
exec = "cutentr";
categories = [ "Game" ];
});
nativeBuildInputs = [
libsForQt5.wrapQtAppsHook
copyDesktopItems
];
buildInputs = [
libsForQt5.qtbase
];
buildPhase = ''
runHook preBuild
qmake
make
runHook postBuild
'';
installPhase = ''
runHook preInstall
mkdir -p $out/bin
cp -r cutentr $out/bin
install -m 444 -D setup/gui/com.gitlab.BoltsJ.cuteNTR.svg $out/share/icons/hicolor/scalable/apps/cutentr.svg
runHook postInstall
'';
meta = {
description = "3DS streaming client for Linux";
homepage = "https://gitlab.com/BoltsJ/cuteNTR";
license = lib.licenses.gpl3Plus;
mainProgram = "cutentr";
platforms = [ "x86_64-linux" ];
maintainers = [ lib.maintainers.EarthGman ];
};
}

View File

@@ -0,0 +1,33 @@
{
lib,
stdenv,
fetchurl,
SDL,
SDL_mixer,
zlib,
}:
stdenv.mkDerivation {
pname = "cuyo";
version = "2.1.0";
src = fetchurl {
url = "mirror://savannah/cuyo/cuyo-2.1.0.tar.gz";
sha256 = "17yqv924x7yvwix7yz9jdhgyar8lzdhqvmpvv0any8rdkajhj23c";
};
buildInputs = [
SDL
SDL_mixer
zlib
];
meta = {
homepage = "http://karimmi.de/cuyo";
description = "Stacking blocks game, with different rules for each level";
mainProgram = "cuyo";
license = lib.licenses.gpl2Plus;
platforms = lib.platforms.linux;
};
}