On Sun, 5 Feb 2023 16:36:21 +0000
Jon Turney wrote:
> On 05/02/2023 08:37, Takashi Yano via Cygwin-apps wrote:
> > I would like to propose new package openh264, which is
> > a H264 video codec library. This is needed by ffmpeg
> > package I had proposed, and also provided for ffmpeg-free
> > package in fedora.
> > 
> > I already prepared the package at the following location.
> > 
> > https://tyan0.yr32.net/cygwin/x86_64/release/openh264/
> 
> libopenh264 contains a libopenh264.dll file.  This doesn't match the 
> naming convention for cygwin DLLs.  This might need patching in the make 
> machinery somewhere.

As Yaakov mentioned, it seems that binary libopenh264 package
cannot be distributed as a cygwin package, so I re-package
it so that it includes only the header files.

Please check attached cygport file.

-- 
Takashi Yano <takashi.y...@nifty.ne.jp>
NAME="openh264"
VERSION=2.3.1
RELEASE=1
CATEGORY="Video"
SUMMARY="H.264 codec library (headers only)"
DESCRIPTION="OpenH264 is a codec library which supports H.264 encoding and 
decoding. It is suitable for use in real time applications such as WebRTC. This 
package has only headers. If you need library binary itself, you can download 
it from https://github.com/cisco/openh264/.";
HOMEPAGE="https://www.openh264.org/";
LICENSE="BSD-2-Clause"
ARCH="noarch" # This is noarch because it's just header files.

SRC_URI="${NAME}-headers-${VERSION}.tar.xz"

# Make dummy source file for prep if the cleaned one is not exist.
if [ ! -f ${SRC_URI} ]
then
        mkdir ${NAME}-${VERSION}
        touch ${NAME}-${VERSION}/dummy
        tar acf ${SRC_URI} ${NAME}-${VERSION}
        rm -rf ${NAME}-${VERSION}
fi

CYGPORT_USE_UNSTABLE_API=1
src_unpack_hook() {
        if [ $(tar tvf ../../../${SRC_URI} | wc -l)  -eq 2 ] # Source file is 
dummy
        then
                NV=${NAME}-${VERSION}
                pushd ..
                rm -rf ${NV} # Remove dummy source file.
                # Download original source file.
                wget 
https://github.com/cisco/openh264/archive/refs/tags/v${VERSION}.tar.gz
                tar xf v${VERSION}.tar.gz
                rm -f v${VERSION}.tar.gz
                # Make source file which has only necessary header files.
                tar acf ../../${NAME}-headers-${VERSION}.tar.xz 
${NV}/codec/api/wels/*.h
                # Update source directory.
                rm -rf ${NV}
                tar xf ../../${NAME}-headers-${VERSION}.tar.xz
                popd
        fi
}
        
PKG_NAMES="libopenh264-headers"
libopenh264_headers_CATEGORY="Video Devel"
libopenh264_headers_CONTENTS="usr/include"

src_compile() {
        :
}

src_install() {
        mkdir -p ${D}/usr/include
        ln -fs ${S}/codec/api/wels ${D}/usr/include/.
}

Reply via email to