add frege
This commit is contained in:
parent
7876a8ac3e
commit
ed3d62d8b9
3 changed files with 208 additions and 6 deletions
72
ajatt/packages/frege.scm
Normal file
72
ajatt/packages/frege.scm
Normal file
|
|
@ -0,0 +1,72 @@
|
|||
;;; Copyright © 2026 Hashirama Senju
|
||||
(define-module (onix packages scala)
|
||||
#:use-module ((guix licenses) #:prefix license:)
|
||||
#:use-module (gnu packages)
|
||||
#:use-module (guix packages)
|
||||
#:use-module (guix download)
|
||||
#:use-module (guix git-download)
|
||||
#:use-module (guix utils)
|
||||
#:use-module (guix build-system ant)
|
||||
#:use-module (guix build-system copy)
|
||||
#:use-module (gnu packages base)
|
||||
#:use-module (gnu packages bash)
|
||||
#:use-module (gnu packages compression)
|
||||
#:use-module (gnu packages java)
|
||||
#:use-module (gnu packages elf)
|
||||
#:use-module (gnu packages protobuf)
|
||||
#:use-module (gnu packages web)
|
||||
#:use-module (srfi srfi-1))
|
||||
|
||||
(define-public frege
|
||||
(package
|
||||
(name "frege")
|
||||
(version "3.24.394")
|
||||
(source
|
||||
(origin
|
||||
(method url-fetch)
|
||||
(uri
|
||||
(let* ((p (string-split version #\.))
|
||||
(tag (string-append (string-join (take p 2) ".") "public")))
|
||||
(string-append
|
||||
"https://github.com/Frege/frege/releases/download/"
|
||||
tag "/frege" version ".jar")))
|
||||
(file-name (string-append "frege-" version ".jar"))
|
||||
(sha256
|
||||
(base32 "1zic5mrk1h79959hqqvka7wzavqbjhz5c663psjmna9xbz155s5q"))))
|
||||
(build-system copy-build-system)
|
||||
(arguments
|
||||
`(#:tests? #f
|
||||
#:phases
|
||||
(modify-phases %standard-phases
|
||||
|
||||
(replace 'install
|
||||
(lambda* (#:key outputs #:allow-other-keys)
|
||||
(let* ((out (assoc-ref outputs "out"))
|
||||
(jar (car (find-files "." "\\.jar$"))))
|
||||
(mkdir-p (string-append out "/share/java"))
|
||||
(copy-file jar
|
||||
(string-append out "/share/java/" (basename jar))))))
|
||||
|
||||
(add-after 'install 'make-wrapper
|
||||
(lambda* (#:key inputs outputs #:allow-other-keys)
|
||||
(let* ((out (assoc-ref outputs "out"))
|
||||
(java (string-append (assoc-ref inputs "openjdk") "/bin/java"))
|
||||
(jar (car (find-files
|
||||
(string-append out "/share/java")
|
||||
"\\.jar$"))))
|
||||
(mkdir-p (string-append out "/bin"))
|
||||
(call-with-output-file (string-append out "/bin/frege")
|
||||
(lambda (port)
|
||||
(format port
|
||||
"#!~a\nexec ~a -jar ~a \"$@\"\n"
|
||||
(which "sh") java jar)))
|
||||
(chmod (string-append out "/bin/frege") #o755)))))))
|
||||
(inputs
|
||||
`(("openjdk" ,openjdk)))
|
||||
(home-page "https://github.com/Frege/frege")
|
||||
(synopsis "Frege compiler (Haskell language for the JVM)")
|
||||
(description
|
||||
"Frege is a Haskell for the JVM")
|
||||
(license license:bsd-3)))
|
||||
|
||||
frege
|
||||
|
|
@ -0,0 +1,74 @@
|
|||
diff --git a/dlnameta.c b/dlnameta.c
|
||||
index 4127e9d..cbc329e 100644
|
||||
--- a/dlnameta.c
|
||||
+++ b/dlnameta.c
|
||||
@@ -282,15 +282,15 @@ get_dlna_metadata_audio(int fd)
|
||||
break;
|
||||
}
|
||||
/* AAC @ Level 1/2 */
|
||||
- if( ac->channels <= 2 && ac->bit_rate <= 320000 )
|
||||
+ if( ac->ch_layout.nb_channels <= 2 && ac->bit_rate <= 320000 )
|
||||
xasprintf(&m.dlna_pn, "AAC_ISO_320");
|
||||
- else if( ac->channels <= 2 && ac->bit_rate <= 576000 )
|
||||
+ else if( ac->ch_layout.nb_channels <= 2 && ac->bit_rate <= 576000 )
|
||||
xasprintf(&m.dlna_pn, "AAC_ISO");
|
||||
- else if( ac->channels <= 6 && ac->bit_rate <= 1440000 )
|
||||
+ else if( ac->ch_layout.nb_channels <= 6 && ac->bit_rate <= 1440000 )
|
||||
xasprintf(&m.dlna_pn, "AAC_MULT5_ISO");
|
||||
else
|
||||
DPRINTF(E_DEBUG, L_METADATA, "Unhandled AAC: %d channels, %d bitrate\n",
|
||||
- ac->channels, ac->bit_rate);
|
||||
+ ac->ch_layout.nb_channels, ac->bit_rate);
|
||||
break;
|
||||
default:
|
||||
DPRINTF(E_DEBUG, L_METADATA, "Unhandled AAC type %d [%s]\n", data >> 3);
|
||||
@@ -314,7 +314,7 @@ get_dlna_metadata_audio(int fd)
|
||||
case AV_CODEC_ID_WMALOSSLESS:
|
||||
xasprintf(&m.mime, "audio/x-ms-wma");
|
||||
xasprintf(&m.dlna_pn, "WMALSL%s",
|
||||
- ac->channels > 2 ? "_MULT5" : "");
|
||||
+ ac->ch_layout.nb_channels > 2 ? "_MULT5" : "");
|
||||
break;
|
||||
case AV_CODEC_ID_FLAC:
|
||||
xasprintf(&m.mime, "audio/x-flac");
|
||||
@@ -324,7 +324,7 @@ get_dlna_metadata_audio(int fd)
|
||||
break;
|
||||
case AV_CODEC_ID_PCM_S16LE:
|
||||
/* there are many other PCM codecs, but only this one has mime audio/L16 */
|
||||
- xasprintf(&m.mime, "audio/L16;rate=%d;channels=%d", ac->sample_rate, ac->channels);
|
||||
+ xasprintf(&m.mime, "audio/L16;rate=%d;channels=%d", ac->sample_rate, ac->ch_layout.nb_channels);
|
||||
xasprintf(&m.dlna_pn, "LPCM");
|
||||
break;
|
||||
/* TODO: AV_CODEC_ID_MP2, AV_CODEC_ID_AMR_NB */
|
||||
@@ -453,15 +453,15 @@ get_dlna_metadata_video_ctx(struct AVFormatContext *ctx, int audio_stream, int v
|
||||
break;
|
||||
}
|
||||
/* AAC @ Level 1/2 */
|
||||
- if( ac_params->channels <= 2 &&
|
||||
+ if( ac_params->ch_layout.nb_channels <= 2 &&
|
||||
ac_params->bit_rate <= 576000 )
|
||||
audio_profile = PROFILE_AUDIO_AAC;
|
||||
- else if( ac_params->channels <= 6 &&
|
||||
+ else if( ac_params->ch_layout.nb_channels <= 6 &&
|
||||
ac_params->bit_rate <= 1440000 )
|
||||
audio_profile = PROFILE_AUDIO_AAC_MULT5;
|
||||
else
|
||||
DPRINTF(E_DEBUG, L_METADATA, "Unhandled AAC: %d channels, %d bitrate\n",
|
||||
- ac_params->channels,
|
||||
+ ac_params->ch_layout.nb_channels,
|
||||
ac_params->bit_rate);
|
||||
break;
|
||||
default:
|
||||
diff --git a/metadata.c b/metadata.c
|
||||
index d769d3c..48f205f 100644
|
||||
--- a/metadata.c
|
||||
+++ b/metadata.c
|
||||
@@ -659,7 +659,7 @@ GetVideoMetadata(const char *path, char *name)
|
||||
if( ac )
|
||||
{
|
||||
m.frequency = ac->sample_rate;
|
||||
- m.channels = ac->channels;
|
||||
+ m.channels = ac->ch_layout.nb_channels;
|
||||
}
|
||||
|
||||
int duration, hours, min, sec, ms;
|
||||
|
|
@ -145,6 +145,7 @@
|
|||
#:use-module (gnu packages xiph)
|
||||
#:use-module (gnu packages xml)
|
||||
#:use-module (gnu packages xorg)
|
||||
#:use-module (gnu packages gettext)
|
||||
#:use-module (gnu packages python)
|
||||
#:use-module ((guix licenses) #:prefix license:))
|
||||
|
||||
|
|
@ -485,10 +486,10 @@ audio/video codec library.")
|
|||
#:configure-flags #~(list "--static-bin" )
|
||||
#:phases
|
||||
#~(modify-phases %standard-phases
|
||||
;; this is very weird, but absolutely needed.
|
||||
(replace 'install
|
||||
(lambda* (#:key outputs #:allow-other-keys)
|
||||
(invoke "make" "install")
|
||||
;; this is very weird, but absolutely needed.
|
||||
(replace 'install
|
||||
(lambda* (#:key outputs #:allow-other-keys)
|
||||
(invoke "make" "install")
|
||||
)))))
|
||||
(native-inputs
|
||||
(list (list zlib "static")
|
||||
|
|
@ -504,6 +505,61 @@ audio/video codec library.")
|
|||
(license
|
||||
(list license:lgpl2.1))))
|
||||
|
||||
(define-public readymedia-transcode
|
||||
(package
|
||||
(name "readymedia-transcode")
|
||||
(version "1.3.3")
|
||||
(source
|
||||
(origin
|
||||
(method git-fetch)
|
||||
(uri
|
||||
(git-reference
|
||||
(url "https://github.com/JuanKman94/readymedia-transcode")
|
||||
(commit "eb7ab61b36fd0007edad2a5eea69af41556372bf")))
|
||||
(sha256
|
||||
(base32 "007wxsy93n16ppfx916jjqxlxvjsm8b7gsfwfrqqgcqfspsylgsb"))
|
||||
(patches (list (local-file "patches/readymedia-transcode-ffmpeg7-fix.patch")))))
|
||||
(build-system gnu-build-system)
|
||||
(arguments
|
||||
(list
|
||||
#:configure-flags
|
||||
#~(list "--with-os-name=Linux"
|
||||
"--with-os-version=")
|
||||
#:phases
|
||||
#~(modify-phases %standard-phases
|
||||
(add-before 'bootstrap 'set-aclocal-path
|
||||
(lambda _
|
||||
(setenv "ACLOCAL_FLAGS" "-I m4")))
|
||||
(add-after 'install 'install-transcode-scripts
|
||||
(lambda _
|
||||
(let ((dir (string-append #$output "/share/readymedia/transcodescripts")))
|
||||
(mkdir-p dir)
|
||||
(for-each
|
||||
(lambda (f) (install-file f dir))
|
||||
'("transcodescripts/transcode_audio"
|
||||
"transcodescripts/transcode_video"
|
||||
"transcodescripts/transcode_image"
|
||||
"transcodescripts/transcode_video-hq"
|
||||
"transcodescripts/transcode_video-hardcodesub"))))))))
|
||||
(native-inputs
|
||||
(list autoconf libtool automake gettext-minimal pkg-config))
|
||||
(inputs
|
||||
(list coreutils-minimal
|
||||
ffmpeg
|
||||
flac
|
||||
libexif
|
||||
imagemagick
|
||||
libid3tag
|
||||
libjpeg-turbo
|
||||
libvorbis
|
||||
sqlite
|
||||
zlib))
|
||||
(home-page "https://minidlna.sourceforge.net/")
|
||||
(synopsis "DLNA/UPnP-AV media server")
|
||||
(description
|
||||
"ReadyMedia (formerly known as MiniDLNA) is a simple media server that
|
||||
serves multimedia content to compatible clients on the network. It aims to be
|
||||
fully compliant with DLNA and UPnP-AV standards.")
|
||||
(license license:gpl2)))
|
||||
|
||||
|
||||
vvenc-app
|
||||
readymedia-transcode
|
||||
|
|
|
|||
Loading…
Reference in a new issue