Add shared lib and headers to multimedia/mpv

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

Add shared lib and headers to multimedia/mpv

Brian Callahan-5
Hi ports --

I would like to start building the libmpv shared library and install it
and the headers alongside the mpv binary. I need it for an upcoming port.

The build system is horrendous; this is the only way I could get it to
create a shared library with the right major/minor numbers.

OK?

~Brian


mpv-libmpv.diff (2K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Add shared lib and headers to multimedia/mpv

Stuart Henderson
On 2019/08/05 13:40, Brian Callahan wrote:

> Hi ports --
>
> I would like to start building the libmpv shared library and install it and
> the headers alongside the mpv binary. I need it for an upcoming port.
>
> The build system is horrendous; this is the only way I could get it to
> create a shared library with the right major/minor numbers.
>
> OK?
>
> ~Brian
>

> Index: Makefile
> ===================================================================
> RCS file: /cvs/ports/multimedia/mpv/Makefile,v
> retrieving revision 1.48
> diff -u -p -r1.48 Makefile
> --- Makefile 14 Jul 2019 00:39:38 -0000 1.48
> +++ Makefile 5 Aug 2019 16:54:02 -0000
> @@ -6,7 +6,9 @@ GH_ACCOUNT = mpv-player
>  GH_PROJECT = mpv
>  GH_TAGNAME = v0.29.1
>  
> -REVISION = 0
> +REVISION = 1
> +
> +SHARED_LIBS += mpv                       0.0 # 1.101
>  
>  CATEGORIES = multimedia x11
>  
> @@ -60,6 +62,7 @@ CONFIGURE_ARGS = --confloaddir=${SYSCONF
>   --enable-cdda \
>   --enable-dvdnav \
>   --enable-dvdread \
> + --enable-libmpv-shared \
>   --enable-sndio \
>   --enable-sdl2 \
>   --enable-tv \
> Index: patches/patch-libmpv_client_h
> ===================================================================
> RCS file: patches/patch-libmpv_client_h
> diff -N patches/patch-libmpv_client_h
> --- /dev/null 1 Jan 1970 00:00:00 -0000
> +++ patches/patch-libmpv_client_h 5 Aug 2019 16:54:02 -0000
> @@ -0,0 +1,17 @@
> +$OpenBSD$
> +
> +Could not find an easy way to do this.
> +Must sync with LIBmpv_VERSION.
> +
> +Index: libmpv/client.h
> +--- libmpv/client.h.orig
> ++++ libmpv/client.h
> +@@ -210,7 +210,7 @@ extern "C" {
> +  * relational operators (<, >, <=, >=).
> +  */
> + #define MPV_MAKE_VERSION(major, minor) (((major) << 16) | (minor) | 0UL)
> +-#define MPV_CLIENT_API_VERSION MPV_MAKE_VERSION(1, 101)
> ++#define MPV_CLIENT_API_VERSION MPV_MAKE_VERSION(0, 0)

NAK, it must be under control of the port. Use a placeholder and have it
do a subst of some kind.

> + /**
> +  * The API user is allowed to "#define MPV_ENABLE_DEPRECATED 0" before
> Index: pkg/PLIST
> ===================================================================
> RCS file: /cvs/ports/multimedia/mpv/pkg/PLIST,v
> retrieving revision 1.6
> diff -u -p -r1.6 PLIST
> --- pkg/PLIST 29 Jun 2018 22:16:18 -0000 1.6
> +++ pkg/PLIST 5 Aug 2019 16:54:02 -0000
> @@ -1,5 +1,14 @@
>  @comment $OpenBSD: PLIST,v 1.6 2018/06/29 22:16:18 espie Exp $
>  @bin bin/mpv
> +include/mpv/
> +include/mpv/client.h
> +include/mpv/opengl_cb.h
> +include/mpv/qthelper.hpp
> +include/mpv/render.h
> +include/mpv/render_gl.h
> +include/mpv/stream_cb.h
> +@lib lib/libmpv.so.${LIBmpv_VERSION}
> +lib/pkgconfig/mpv.pc
>  @man man/man1/mpv.1
>  share/applications/mpv.desktop
>  share/examples/mpv/

Reply | Threaded
Open this post in threaded view
|

Re: Add shared lib and headers to multimedia/mpv

Brian Callahan-5


On 8/5/19 1:43 PM, Stuart Henderson wrote:

> On 2019/08/05 13:40, Brian Callahan wrote:
>> Hi ports --
>>
>> I would like to start building the libmpv shared library and install it and
>> the headers alongside the mpv binary. I need it for an upcoming port.
>>
>> The build system is horrendous; this is the only way I could get it to
>> create a shared library with the right major/minor numbers.
>>
>> OK?
>>
>> ~Brian
>>
>> Index: Makefile
>> ===================================================================
>> RCS file: /cvs/ports/multimedia/mpv/Makefile,v
>> retrieving revision 1.48
>> diff -u -p -r1.48 Makefile
>> --- Makefile 14 Jul 2019 00:39:38 -0000 1.48
>> +++ Makefile 5 Aug 2019 16:54:02 -0000
>> @@ -6,7 +6,9 @@ GH_ACCOUNT = mpv-player
>>   GH_PROJECT = mpv
>>   GH_TAGNAME = v0.29.1
>>  
>> -REVISION = 0
>> +REVISION = 1
>> +
>> +SHARED_LIBS += mpv                       0.0 # 1.101
>>  
>>   CATEGORIES = multimedia x11
>>  
>> @@ -60,6 +62,7 @@ CONFIGURE_ARGS = --confloaddir=${SYSCONF
>>   --enable-cdda \
>>   --enable-dvdnav \
>>   --enable-dvdread \
>> + --enable-libmpv-shared \
>>   --enable-sndio \
>>   --enable-sdl2 \
>>   --enable-tv \
>> Index: patches/patch-libmpv_client_h
>> ===================================================================
>> RCS file: patches/patch-libmpv_client_h
>> diff -N patches/patch-libmpv_client_h
>> --- /dev/null 1 Jan 1970 00:00:00 -0000
>> +++ patches/patch-libmpv_client_h 5 Aug 2019 16:54:02 -0000
>> @@ -0,0 +1,17 @@
>> +$OpenBSD$
>> +
>> +Could not find an easy way to do this.
>> +Must sync with LIBmpv_VERSION.
>> +
>> +Index: libmpv/client.h
>> +--- libmpv/client.h.orig
>> ++++ libmpv/client.h
>> +@@ -210,7 +210,7 @@ extern "C" {
>> +  * relational operators (<, >, <=, >=).
>> +  */
>> + #define MPV_MAKE_VERSION(major, minor) (((major) << 16) | (minor) | 0UL)
>> +-#define MPV_CLIENT_API_VERSION MPV_MAKE_VERSION(1, 101)
>> ++#define MPV_CLIENT_API_VERSION MPV_MAKE_VERSION(0, 0)
> NAK, it must be under control of the port. Use a placeholder and have it
> do a subst of some kind.
Alright. Couldn't get SUBST_CMD to work, so used plain old sed.

~Brian

>> + /**
>> +  * The API user is allowed to "#define MPV_ENABLE_DEPRECATED 0" before
>> Index: pkg/PLIST
>> ===================================================================
>> RCS file: /cvs/ports/multimedia/mpv/pkg/PLIST,v
>> retrieving revision 1.6
>> diff -u -p -r1.6 PLIST
>> --- pkg/PLIST 29 Jun 2018 22:16:18 -0000 1.6
>> +++ pkg/PLIST 5 Aug 2019 16:54:02 -0000
>> @@ -1,5 +1,14 @@
>>   @comment $OpenBSD: PLIST,v 1.6 2018/06/29 22:16:18 espie Exp $
>>   @bin bin/mpv
>> +include/mpv/
>> +include/mpv/client.h
>> +include/mpv/opengl_cb.h
>> +include/mpv/qthelper.hpp
>> +include/mpv/render.h
>> +include/mpv/render_gl.h
>> +include/mpv/stream_cb.h
>> +@lib lib/libmpv.so.${LIBmpv_VERSION}
>> +lib/pkgconfig/mpv.pc
>>   @man man/man1/mpv.1
>>   share/applications/mpv.desktop
>>   share/examples/mpv/


mpv-libmpv.diff (2K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Add shared lib and headers to multimedia/mpv

Christian Weisgerber
Brian Callahan:

>  do-configure:
> + sed -i -e "s,LMAJ,`echo ${LIBmpv_VERSION} | cut -f 1 -d .`,g" \
> + -e "s,LMIN,`echo ${LIBmpv_VERSION} | cut -f 2 -d .`,g" \
> + ${WRKSRC}/libmpv/client.h
>   ${DO_WAF} configure ${CONFIGURE_ARGS}

sed -i -e 's,LMAJ,${LIBmpv_VERSION:R},g' \
        -e 's,LMIN,${LIBmpv_VERSION:E},g' \

--
Christian "naddy" Weisgerber                          [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Add shared lib and headers to multimedia/mpv

Brian Callahan-5


On 8/5/19 3:34 PM, Christian Weisgerber wrote:

> Brian Callahan:
>
>>   do-configure:
>> + sed -i -e "s,LMAJ,`echo ${LIBmpv_VERSION} | cut -f 1 -d .`,g" \
>> + -e "s,LMIN,`echo ${LIBmpv_VERSION} | cut -f 2 -d .`,g" \
>> + ${WRKSRC}/libmpv/client.h
>>   ${DO_WAF} configure ${CONFIGURE_ARGS}
> sed -i -e 's,LMAJ,${LIBmpv_VERSION:R},g' \
>          -e 's,LMIN,${LIBmpv_VERSION:E},g' \
>
Learned something new today. New diff attached.

~Brian


mpv-libmpv3.diff (2K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Add shared lib and headers to multimedia/mpv

Stuart Henderson
On 2019/08/05 22:04, Brian Callahan wrote:

>
>
> On 8/5/19 3:34 PM, Christian Weisgerber wrote:
> > Brian Callahan:
> >
> > >   do-configure:
> > > + sed -i -e "s,LMAJ,`echo ${LIBmpv_VERSION} | cut -f 1 -d .`,g" \
> > > + -e "s,LMIN,`echo ${LIBmpv_VERSION} | cut -f 2 -d .`,g" \
> > > + ${WRKSRC}/libmpv/client.h
> > >   ${DO_WAF} configure ${CONFIGURE_ARGS}
> > sed -i -e 's,LMAJ,${LIBmpv_VERSION:R},g' \
> >          -e 's,LMIN,${LIBmpv_VERSION:E},g' \
> >
>
> Learned something new today. New diff attached.

That looks good. OK with me but a few words of caution (I don't know
what will use this library so can't check myself):

- watch out for ports depending on this checking the version number
they've been compiled against. if they do a tight check on this (as done
by irssi plugins and some users of sqlite3) that effectively means every
bump has to be a major bump, which has implications for -stable

- they are documenting things against specific api version numbers,
so also watch out for things using MPV_CLIENT_API_VERSION or similar
to check for features in #ifdefs etc

> Index: Makefile
> ===================================================================
> RCS file: /cvs/ports/multimedia/mpv/Makefile,v
> retrieving revision 1.48
> diff -u -p -r1.48 Makefile
> --- Makefile 14 Jul 2019 00:39:38 -0000 1.48
> +++ Makefile 6 Aug 2019 02:03:52 -0000
> @@ -6,7 +6,9 @@ GH_ACCOUNT = mpv-player
>  GH_PROJECT = mpv
>  GH_TAGNAME = v0.29.1
>  
> -REVISION = 0
> +REVISION = 1
> +
> +SHARED_LIBS += mpv                       0.0 # 1.101
>  
>  CATEGORIES = multimedia x11
>  
> @@ -60,6 +62,7 @@ CONFIGURE_ARGS = --confloaddir=${SYSCONF
>   --enable-cdda \
>   --enable-dvdnav \
>   --enable-dvdread \
> + --enable-libmpv-shared \
>   --enable-sndio \
>   --enable-sdl2 \
>   --enable-tv \
> @@ -110,6 +113,9 @@ post-patch:
>   cp ${DISTDIR}/${WAF:T} ${WAF}
>  
>  do-configure:
> + sed -i -e "s,LMAJ,${LIBmpv_VERSION:R},g" \
> + -e "s,LMIN,${LIBmpv_VERSION:E},g" \
> + ${WRKSRC}/libmpv/client.h
>   ${DO_WAF} configure ${CONFIGURE_ARGS}
>  
>  do-build:
> Index: patches/patch-libmpv_client_h
> ===================================================================
> RCS file: patches/patch-libmpv_client_h
> diff -N patches/patch-libmpv_client_h
> --- /dev/null 1 Jan 1970 00:00:00 -0000
> +++ patches/patch-libmpv_client_h 6 Aug 2019 02:03:52 -0000
> @@ -0,0 +1,16 @@
> +$OpenBSD$
> +
> +Could not find an easy way to do this.
> +
> +Index: libmpv/client.h
> +--- libmpv/client.h.orig
> ++++ libmpv/client.h
> +@@ -210,7 +210,7 @@ extern "C" {
> +  * relational operators (<, >, <=, >=).
> +  */
> + #define MPV_MAKE_VERSION(major, minor) (((major) << 16) | (minor) | 0UL)
> +-#define MPV_CLIENT_API_VERSION MPV_MAKE_VERSION(1, 101)
> ++#define MPV_CLIENT_API_VERSION MPV_MAKE_VERSION(LMAJ, LMIN)
> +
> + /**
> +  * The API user is allowed to "#define MPV_ENABLE_DEPRECATED 0" before
> Index: pkg/PLIST
> ===================================================================
> RCS file: /cvs/ports/multimedia/mpv/pkg/PLIST,v
> retrieving revision 1.6
> diff -u -p -r1.6 PLIST
> --- pkg/PLIST 29 Jun 2018 22:16:18 -0000 1.6
> +++ pkg/PLIST 6 Aug 2019 02:03:52 -0000
> @@ -1,5 +1,14 @@
>  @comment $OpenBSD: PLIST,v 1.6 2018/06/29 22:16:18 espie Exp $
>  @bin bin/mpv
> +include/mpv/
> +include/mpv/client.h
> +include/mpv/opengl_cb.h
> +include/mpv/qthelper.hpp
> +include/mpv/render.h
> +include/mpv/render_gl.h
> +include/mpv/stream_cb.h
> +@lib lib/libmpv.so.${LIBmpv_VERSION}
> +lib/pkgconfig/mpv.pc
>  @man man/man1/mpv.1
>  share/applications/mpv.desktop
>  share/examples/mpv/