ttaenc: init at 3.4.1

This commit is contained in:
Natsu Kagami 2023-06-20 15:01:14 +02:00
parent 11b62e658f
commit c609f1e371
No known key found for this signature in database
GPG Key ID: 55A032EB38B49ADB
3 changed files with 69 additions and 0 deletions

View File

@ -0,0 +1,15 @@
--- a/Makefile
+++ b/Makefile
@@ -8,10 +8,10 @@
INSDIR = /usr/bin
ttaenc: $(patsubst %.c, %.o, $(wildcard *.c))
- gcc $^ -o $@ $(CFLAGS)
+ $(CC) $^ -o $@ $(CFLAGS)
%.o: %.c
- gcc -c $(CFLAGS) $<
+ $(CC) -c $(CFLAGS) $<
install:
[ -d "$(INSDIR)" ] || mkdir $(INSDIR)

View File

@ -0,0 +1,44 @@
{
stdenv,
lib,
fetchurl,
}:
stdenv.mkDerivation (finalAttrs: {
pname = "ttaenc";
version = "3.4.1";
src = fetchurl {
url = "mirror://sourceforge/tta/ttaenc-${finalAttrs.version}-src.tgz";
sha256 = "sha256-ssnIsBWsxYZPCCoBV/LgnFEX0URTIctheOkltEi+PcY=";
};
patches = [
./makefile.patch # Use stdenv's CC
./ttaenc-inline.patch # Patch __inline used into always_inline for both GCC and clang
];
makeFlags = [ "INSDIR=$(out)/bin" ];
preBuild = ''
# From the Makefile, with `-msse` removed, since we have those on by x86_64 by default.
makeFlagsArray+=(CFLAGS="-Wall -O2 -fomit-frame-pointer -funroll-loops -fforce-addr -falign-functions=4")
'';
postInstall = ''
# Copy docs
install -dm755 "$out/share/doc/${finalAttrs.pname}"
install -m644 "ChangeLog-${finalAttrs.version}" README "$out/share/doc/${finalAttrs.pname}"
'';
meta = {
description = "Lossless compressor for multichannel 8, 16 and 24 bits audio data, with the ability of password data protection";
homepage = "https://sourceforge.net/projects/tta/";
license = with lib.licenses; [
gpl3Only
lgpl3Only
];
platforms = lib.platforms.unix;
mainProgram = "ttaenc";
maintainers = with lib.maintainers; [ natsukagami ];
};
})

View File

@ -0,0 +1,10 @@
--- a/ttaenc.c
+++ b/ttaenc.c
@@ -10,6 +10,7 @@
*/
#include "ttaenc.h"
+#define __inline static inline __attribute__((always_inline))
/******************* static variables and structures *******************/