Skip to content

Commit

Permalink
ttaenc: init at 3.4.1 (#238757)
Browse files Browse the repository at this point in the history
  • Loading branch information
FliegendeWurst authored Dec 13, 2024
2 parents 355151f + c609f1e commit b8d33d0
Show file tree
Hide file tree
Showing 4 changed files with 72 additions and 2 deletions.
5 changes: 3 additions & 2 deletions maintainers/maintainer-list.nix
Original file line number Diff line number Diff line change
Expand Up @@ -15573,10 +15573,11 @@
name = "Nathan Yong";
};
natsukagami = {
email = "[email protected]";
name = "Natsu Kagami";
email = "[email protected]";
matrix = "@nki:m.nkagami.me";
github = "natsukagami";
githubId = 9061737;
name = "Natsu Kagami";
keys = [ { fingerprint = "5581 26DC 886F E14D 501D B0F2 D6AD 7B57 A992 460C"; } ];
};
natsukium = {
Expand Down
15 changes: 15 additions & 0 deletions pkgs/by-name/tt/ttaenc/makefile.patch
Original file line number Diff line number Diff line change
@@ -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)
44 changes: 44 additions & 0 deletions pkgs/by-name/tt/ttaenc/package.nix
Original file line number Diff line number Diff line change
@@ -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 ];
};
})
10 changes: 10 additions & 0 deletions pkgs/by-name/tt/ttaenc/ttaenc-inline.patch
Original file line number Diff line number Diff line change
@@ -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 *******************/

0 comments on commit b8d33d0

Please sign in to comment.