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,40 @@
From 6ac2f207e8d8e1d16ee73198abccc64d20c5f608 Mon Sep 17 00:00:00 2001
From: benaryorg <binary@benary.org>
Date: Thu, 7 Nov 2024 03:27:52 +0000
Subject: [PATCH 1/2] proper pthread return value
*pthread_create(3)* states that the ways for a pthread to exit includes:
> It returns from start_routine(). This is equivalent to calling pthread_exit(3) with the value supplied in the return statement.
This "retval" is a void pointer which can be anything.
In this case, since all threads are always joined with a parameter of NULL for the `void**` to store the retval this isn't really relevant for providing a meaningful return value.
However a `void*` function must return a `void*`, otherwise compilers will complain:
> pHash.cpp:416:1: warning: no return statement in function returning non-void [8;;https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html#index-Wreturn-type-Wreturn-type8;;]
Therefore returning NULL seems reasonable.
As for the choice of NULL vs. nullptr or any other value, NULL is already widely used in the file.
Long story short: this fixes a compiler warning/error.
Signed-off-by: benaryorg <binary@benary.org>
---
src/pHash.cpp | 1 +
1 file changed, 1 insertion(+)
diff --git a/src/pHash.cpp b/src/pHash.cpp
index 07b03ad..23bbbf3 100644
--- a/src/pHash.cpp
+++ b/src/pHash.cpp
@@ -417,6 +417,7 @@ void *ph_image_thread(void *p)
memcpy(dp->hash, &hash, sizeof(hash));
dp->hash_length = 1;
}
+ return NULL;
}
DP** ph_dct_image_hashes(char *files[], int count, int threads)
--
2.44.1

View File

@@ -0,0 +1,52 @@
{
lib,
stdenv,
fetchFromGitHub,
pkg-config,
cimg,
imagemagick,
}:
stdenv.mkDerivation rec {
pname = "pHash";
version = "0.9.6";
buildInputs = [ cimg ];
# CImg.h calls to external binary `convert` from the `imagemagick` package
# at runtime
propagatedBuildInputs = [ imagemagick ];
nativeBuildInputs = [ pkg-config ];
configureFlags = [
"--enable-video-hash=no"
"--enable-audio-hash=no"
];
postInstall = ''
cp ${cimg}/include/CImg.h $out/include/
'';
src = fetchFromGitHub {
owner = "clearscene";
repo = "pHash";
rev = version;
sha256 = "sha256-frISiZ89ei7XfI5F2nJJehfQZsk0Mlb4n91q/AiZ2vA=";
};
NIX_LDFLAGS = "-lfftw3_threads";
patches = [
# proper pthread return value (https://github.com/clearscene/pHash/pull/20)
./0001-proper-pthread-return-value.patch
];
meta = with lib; {
description = "Compute the perceptual hash of an image";
license = licenses.gpl3;
maintainers = [ maintainers.imalsogreg ];
platforms = platforms.all;
homepage = "http://www.phash.org";
downloadPage = "https://github.com/clearscene/pHash";
};
}