tg-timer: init at 0.7.0
This commit is contained in:
@@ -0,0 +1,18 @@
|
||||
diff --git a/src/audio.c b/src/audio.c
|
||||
index d1b9762..cb544dd 100644
|
||||
|
||||
This package assumes that there will always be an audio device while testing.
|
||||
If there is not an audio device, it segfaults. So in the Nix sandbox, it
|
||||
unconditionally segfaults without this patch. This patch allows the tests
|
||||
to flow through the normal error handling logic.
|
||||
|
||||
--- a/src/audio.c
|
||||
+++ b/src/audio.c
|
||||
@@ -637,7 +637,6 @@ int start_portaudio(int device, int *nominal_sample_rate, double *real_sample_ra
|
||||
if(testing) {
|
||||
*nominal_sample_rate = PA_SAMPLE_RATE;
|
||||
*real_sample_rate = PA_SAMPLE_RATE;
|
||||
- goto end;
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -0,0 +1,74 @@
|
||||
{
|
||||
lib,
|
||||
stdenv,
|
||||
fetchFromGitHub,
|
||||
# Configure
|
||||
autoreconfHook,
|
||||
# Build binaries
|
||||
pkg-config,
|
||||
# Build libraries
|
||||
gtk3,
|
||||
portaudio,
|
||||
fftwFloat,
|
||||
libjack2,
|
||||
python3,
|
||||
# Check Binaries
|
||||
xvfb-run,
|
||||
}:
|
||||
stdenv.mkDerivation (finalAttrs: {
|
||||
pname = "tg-timer";
|
||||
version = "0.7.0";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "xyzzy42";
|
||||
repo = "tg";
|
||||
tag = "v${finalAttrs.version}-tpiepho";
|
||||
hash = "sha256-9QeTjr/J0Y10YfPKEfYnciu5z2+hmmWFKLdw6CCS3hU=";
|
||||
};
|
||||
|
||||
patches = [
|
||||
./audio.patch
|
||||
];
|
||||
|
||||
nativeBuildInputs = [
|
||||
autoreconfHook
|
||||
pkg-config
|
||||
];
|
||||
|
||||
buildInputs = [
|
||||
gtk3
|
||||
portaudio
|
||||
fftwFloat
|
||||
libjack2
|
||||
(python3.withPackages (p: [
|
||||
p.numpy
|
||||
p.matplotlib
|
||||
p.libtfr
|
||||
p.scipy
|
||||
]))
|
||||
];
|
||||
|
||||
enableParallelBuilding = true;
|
||||
|
||||
doCheck = true;
|
||||
nativeCheckInputs = [
|
||||
xvfb-run
|
||||
];
|
||||
checkPhase = ''
|
||||
runHook preCheck
|
||||
|
||||
xvfb-run -s '-screen 0 800x600x24' \
|
||||
make -j "$NIX_BUILD_CORES" test
|
||||
|
||||
runHook postCheck
|
||||
'';
|
||||
|
||||
meta = {
|
||||
description = "for timing mechanical watches";
|
||||
homepage = "https://github.com/xyzzy42/tg";
|
||||
changelog = "https://github.com/xyzzy42/tg/releases/tag/v${finalAttrs.version}-tpiepho";
|
||||
license = lib.licenses.gpl2Plus;
|
||||
mainProgram = "tg";
|
||||
maintainers = with lib.maintainers; [ RossSmyth ];
|
||||
};
|
||||
})
|
||||
Reference in New Issue
Block a user