Home | News | Download | Packages | Forum | Wiki | Github

Makemkv: problem with libressl


#1

Hello,

I use makemkv to rip my bluray. Unfortunatly I can’t package it. For the moment, my template is the following:

# Template file for 'makemkv'
pkgname=makemkv
version=1.10.6
revision=1
wrksrc="${pkgname}-oss-${version}"
#create_wrksrc=yes
#only_for_archs="i686 x86_64"
build_style=gnu-configure
#configure_args=""
#make_build_args=""
#make_install_args=""
#conf_files=""
#make_dirs="/var/log/dir 0755 root root"
hostmakedepends=""
makedepends="expat-devel ffmpeg-devel libressl-devel pkg-config  qt5-devel zlib-devel"
depends=""
short_desc="DVD and Blu-ray to MKV converter and network streamer"
maintainer="Rocket"
license="LGPL"
homepage="http://www.makemkv.com"
distfiles="${homepage}/download/${pkgname}-bin-${version}.tar.gz
${homepage}/download/${pkgname}-oss-${version}.tar.gz"
checksum="99d68e4e0166c9a4e2dce6638e19cbe312b5981f6e1811ed0987578ceefac3e3
ab028ba05364f2d899b76e6a7392c9ef555379de2ef4732e1de27c23fd78d235"

do_configure(){
    ./configure --prefix=/usr
}

do_build(){
    make
}


do_install(){
    make install
}

I get the following error:

In file included from libffabi/src/ffabi.c:22:0:
/usr/include/libavcodec/avcodec.h:5377:5: note: declared here
 int avcodec_encode_audio2(AVCodecContext *avctx, AVPacket *avpkt,
     ^~~~~~~~~~~~~~~~~~~~~
/tmp/cceUe7uR.o: In function `OSSL_ECDSA_do_verify_rs':
ossl_ec.c:(.text+0x27e): undefined reference to `ECDSA_SIG_set0'
/tmp/cceUe7uR.o: In function `OSSL_ecdsa_sig_get_r':
ossl_ec.c:(.text+0x2da): undefined reference to `ECDSA_SIG_get0'
/tmp/cceUe7uR.o: In function `OSSL_ecdsa_sig_get_s':
ossl_ec.c:(.text+0x31a): undefined reference to `ECDSA_SIG_get0'
collect2: error: ld returned 1 exit status
make: *** [Makefile:75: out/libmakemkv.so.1.full] Error 1
=> ERROR: makemkv-1.10.6_1: failed to run do_build() at line 33.

After searching, the problem has to do with libressl. It seems there was a change in openssl recently. The problem is in the file libabi/src/ossl_ec.c:

#if (OPENSSL_VERSION_NUMBER >= 0x10100006L)
    {
        ECDSA_SIG *sig = ECDSA_SIG_new();
        if (!sig) return -1;
        if (ECDSA_SIG_set0(sig,BN_dup((const BIGNUM*)sig_r),BN_dup((const BIGNUM*)sig_s))>0)
        {
            r = ECDSA_do_verify(dgst,dgst_len,sig,(EC_KEY*) eckey);
        }
        ECDSA_SIG_free(sig);
    }
#else
    {
        OSSL_ECDSA_SIG_ACCESS sig;
        sig.r = (BIGNUM *)sig_r;
        sig.s = (BIGNUM *)sig_s;
        r = ECDSA_do_verify(dgst,dgst_len,(ECDSA_SIG*)&sig,(EC_KEY*) eckey);
    }
#endif

If the else part is executed, it’s possible to compile without errors (there are 3 modifications to do). I never did such a change. So my questions:

  • how can I fix it ?
  • Do I have to wait for an update of libressl or to report the problem to the dev of makemkv ?

Thank you!


#2

Patch libabi/ossl_ec.c
mkdir -p void-packages/srcpkgs/makemkv/patches
Copy/paste into a file called libressl.patch

--- libabi/src/ossl_ec.c.old	2017-05-27 16:10:21.000000000 -0400
+++ libabi/src/ossl_ec.c	2017-07-25 14:50:44.039398939 -0400
@@ -215,7 +215,7 @@
 {
     int r = -1;
 
-#if (OPENSSL_VERSION_NUMBER >= 0x10100006L)
+#if OPENSSL_VERSION_NUMBER >= 0x10100006L && !defined(LIBRESSL_VERSION_NUMBER) 
     {
         ECDSA_SIG *sig = ECDSA_SIG_new();
         if (!sig) return -1;
@@ -239,7 +239,7 @@
 
 const OSSL_BIGNUM* OSSL_ecdsa_sig_get_r(const OSSL_ECDSA_SIG* sig)
 {
-#if (OPENSSL_VERSION_NUMBER >= 0x10100006L)
+#if OPENSSL_VERSION_NUMBER >= 0x10100006L && !defined(LIBRESSL_VERSION_NUMBER)
     {
         const BIGNUM* r;
         ECDSA_SIG_get0((const ECDSA_SIG*)sig,&r,NULL);
@@ -252,7 +252,7 @@
 
 const OSSL_BIGNUM* OSSL_ecdsa_sig_get_s(const OSSL_ECDSA_SIG* sig)
 {
-#if (OPENSSL_VERSION_NUMBER >= 0x10100006L)
+#if OPENSSL_VERSION_NUMBER >= 0x10100006L && !defined(LIBRESSL_VERSION_NUMBER)
     {
         const BIGNUM* s;
         ECDSA_SIG_get0((const ECDSA_SIG*)sig,NULL,&s);
cp libressl.patch void-packages/srcpkgs/makemkv/patches

# Template file for 'makemkv'
pkgname=makemkv
version=1.10.6
revision=1
wrksrc="${pkgname}-oss-${version}"
#create_wrksrc=yes
#only_for_archs="i686 x86_64"
build_style=gnu-configure
#configure_args=""
#make_build_args=""
#make_install_args=""
#conf_files=""
#make_dirs="/var/log/dir 0755 root root"
hostmakedepends=""
makedepends="expat-devel ffmpeg-devel libressl-devel pkg-config  qt5-devel zlib-devel"
depends=""
short_desc="DVD and Blu-ray to MKV converter and network streamer"
maintainer="Rocket"
license="LGPL"
homepage="http://www.makemkv.com"
distfiles="${homepage}/download/${pkgname}-bin-${version}.tar.gz
${homepage}/download/${pkgname}-oss-${version}.tar.gz"
checksum="99d68e4e0166c9a4e2dce6638e19cbe312b5981f6e1811ed0987578ceefac3e3
ab028ba05364f2d899b76e6a7392c9ef555379de2ef4732e1de27c23fd78d235"

#3

Thank you for fix! I thought I had to do something in that direction.

Before I close this subject, two questions are remaining. Could you tell me where I can report the problem ? So it would be possible to get rid of the patch.

And the new one: is it possible to propose my template and patch to get makemkv packaged ? This software is not free, so I don’t know if it’s possible.


(David Lebel) #4

Using the template and fix I manage to compile MakeMKV, but upon start up, I get Application failed to initialize error.

I modified the template for 1.10.7, but I have the same problem with 1.10.6.

Anybody with an idea what’s going on?


#5

Did you remember to install the binary part? I forgot and got the same error.


(David Lebel) #6

Oh, so the template doesn’t handle the -bin tarball ? Surprising that it does download it and doesn’t handle it and install it along the compiled source tarball?

Is there a way to fix this? I’m not that used to xbps-src system yet…


#7

I compiled it without the template, so I can’t say anything about that. It seems to be in the distfiles though.


(David Lebel) #8

It is in the template and distfiles, but it doesn’t seem to handle it, the bin part. Only the src part.