From 7a709ed40d7e1562d7778b857533b36af8262679 Mon Sep 17 00:00:00 2001 From: Vincent Fortier Date: Sun, 27 Nov 2022 15:16:22 +0000 Subject: [PATCH 1/7] libtasn1: Update from version 4.17.0 to 4.19.0 This fixes build issue on compilers < 4.9 --- cross/libtasn1/Makefile | 4 ++-- cross/libtasn1/PLIST | 2 +- cross/libtasn1/digests | 6 +++--- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/cross/libtasn1/Makefile b/cross/libtasn1/Makefile index 4e6a75031f6..705d5f1a526 100644 --- a/cross/libtasn1/Makefile +++ b/cross/libtasn1/Makefile @@ -1,5 +1,5 @@ PKG_NAME = libtasn1 -PKG_VERS = 4.17.0 +PKG_VERS = 4.19.0 PKG_EXT = tar.gz PKG_DIST_NAME = $(PKG_NAME)-$(PKG_VERS).$(PKG_EXT) PKG_DIST_SITE = https://ftp.gnu.org/gnu/$(PKG_NAME) @@ -13,6 +13,6 @@ LICENSE = LGPLv2.1 GNU_CONFIGURE = 1 CONFIGURE_ARGS = --disable-gcc-warnings --disable-static -ADDITIONAL_CPPFLAGS = -std=c99 +ADDITIONAL_CFLAGS = -std=gnu99 include ../../mk/spksrc.cross-cc.mk diff --git a/cross/libtasn1/PLIST b/cross/libtasn1/PLIST index 433aa1b9eee..f59ee7f9abd 100644 --- a/cross/libtasn1/PLIST +++ b/cross/libtasn1/PLIST @@ -3,4 +3,4 @@ bin:bin/asn1Decoding bin:bin/asn1Parser lnk:lib/libtasn1.so lnk:lib/libtasn1.so.6 -lib:lib/libtasn1.so.6.6.1 +lib:lib/libtasn1.so.6.6.3 diff --git a/cross/libtasn1/digests b/cross/libtasn1/digests index 0da97d5b898..e675b809488 100644 --- a/cross/libtasn1/digests +++ b/cross/libtasn1/digests @@ -1,3 +1,3 @@ -libtasn1-4.17.0.tar.gz SHA1 327c3f1305a502dbceb098838a9baed2f0449ddd -libtasn1-4.17.0.tar.gz SHA256 ece7551cea7922b8e10d7ebc70bc2248d1fdd73351646a2d6a8d68a9421c45a5 -libtasn1-4.17.0.tar.gz MD5 c46f6eb3bd1287031ae5d36465094402 +libtasn1-4.19.0.tar.gz SHA1 9c4b6616de65513a0a4d27e0b7f25184391ca8fd +libtasn1-4.19.0.tar.gz SHA256 1613f0ac1cf484d6ec0ce3b8c06d56263cc7242f1c23b30d82d23de345a63f7a +libtasn1-4.19.0.tar.gz MD5 f701ab57eb8e7d9c105b2cd5d809b29a From de898a18bc9ccd59d4f8cda179d14b2f21d5c729 Mon Sep 17 00:00:00 2001 From: Vincent Fortier Date: Sun, 27 Nov 2022 15:38:09 +0000 Subject: [PATCH 2/7] tvheadend+libdvbcsa: Add OSCam support --- .../patches/001-libdvbcsa-OSCam-support.patch | 149 ++++++++++++++++++ .../patches/005-tvh-OSCam-support.patch | 96 +++++++++++ spk/tvheadend/Makefile | 4 +- 3 files changed, 247 insertions(+), 2 deletions(-) create mode 100644 cross/libdvbcsa/patches/001-libdvbcsa-OSCam-support.patch create mode 100644 cross/tvheadend/patches/005-tvh-OSCam-support.patch diff --git a/cross/libdvbcsa/patches/001-libdvbcsa-OSCam-support.patch b/cross/libdvbcsa/patches/001-libdvbcsa-OSCam-support.patch new file mode 100644 index 00000000000..ea878b9034b --- /dev/null +++ b/cross/libdvbcsa/patches/001-libdvbcsa-OSCam-support.patch @@ -0,0 +1,149 @@ +diff -uprN ../libdvbcsa-2a1e61e569a621c55c2426f235f42c2398b7f18f-orig/src/dvbcsa/dvbcsa.h ./src/dvbcsa/dvbcsa.h +--- ../libdvbcsa-2a1e61e569a621c55c2426f235f42c2398b7f18f-orig/src/dvbcsa/dvbcsa.h 2018-01-28 13:04:27.000000000 +0000 ++++ ./src/dvbcsa/dvbcsa.h 2022-11-27 15:34:26.246312074 +0000 +@@ -93,6 +93,8 @@ void dvbcsa_bs_key_free(struct dvbcsa_bs + + void dvbcsa_bs_key_set(const dvbcsa_cw_t cw, struct dvbcsa_bs_key_s *key); + ++void dvbcsa_bs_key_set_ecm(const unsigned char ecm, const dvbcsa_cw_t cw, struct dvbcsa_bs_key_s *key); ++ + /** get maximum number of packet per batch */ + + unsigned int dvbcsa_bs_batch_size(void); +diff -uprN ../libdvbcsa-2a1e61e569a621c55c2426f235f42c2398b7f18f-orig/src/dvbcsa_bs_key.c ./src/dvbcsa_bs_key.c +--- ../libdvbcsa-2a1e61e569a621c55c2426f235f42c2398b7f18f-orig/src/dvbcsa_bs_key.c 2018-01-28 13:04:27.000000000 +0000 ++++ ./src/dvbcsa_bs_key.c 2022-11-27 15:34:26.246312074 +0000 +@@ -63,3 +63,39 @@ dvbcsa_bs_key_set (const dvbcsa_cw_t cw, + } + } + ++void ++dvbcsa_bs_key_set_ecm (const unsigned char ecm, const dvbcsa_cw_t cw, struct dvbcsa_bs_key_s *key) ++{ ++ dvbcsa_keys_t kk; ++ int i; ++ ++ /* precalculations for stream */ ++ ++ uint64_t ck = dvbcsa_load_le64(cw); ++ ++ for (i = 0; i < DVBCSA_CWBITS_SIZE; i++) ++ key->stream[i] = (ck >> (i^4)) & 1 ? BS_VAL8(ff) : BS_VAL8(00); ++ ++ /* precalculations for block */ ++ ++ dvbcsa_key_schedule_block_ecm(ecm, cw, kk); ++ ++ for (i = 0; i < DVBCSA_KEYSBUFF_SIZE; i++) ++ { ++#if BS_BATCH_SIZE == 32 ++ *(dvbcsa_u32_aliasing_t *)(key->block + i) = kk[i] * 0x01010101; ++ ++#elif BS_BATCH_SIZE == 64 ++ *(dvbcsa_u64_aliasing_t *)(key->block + i) = kk[i] * 0x0101010101010101ULL; ++ ++#elif BS_BATCH_SIZE > 64 && BS_BATCH_SIZE % 64 == 0 ++ uint64_t v = kk[i] * 0x0101010101010101ULL; ++ int j; ++ ++ for (j = 0; j < BS_BATCH_BYTES / 8; j++) ++ *((dvbcsa_u64_aliasing_t *)(key->block + i) + j) = v; ++#else ++# error ++#endif ++ } ++} +diff -uprN ../libdvbcsa-2a1e61e569a621c55c2426f235f42c2398b7f18f-orig/src/dvbcsa_key.c ./src/dvbcsa_key.c +--- ../libdvbcsa-2a1e61e569a621c55c2426f235f42c2398b7f18f-orig/src/dvbcsa_key.c 2018-01-28 13:04:27.000000000 +0000 ++++ ./src/dvbcsa_key.c 2022-11-27 15:34:26.246312074 +0000 +@@ -585,3 +585,18 @@ dvbcsa_key_schedule_block(const dvbcsa_c + kk[i*8+j] = (k[i]>>(j*8)) ^ i; + } + ++void ++dvbcsa_key_schedule_block_ecm(const unsigned char ecm, const dvbcsa_cw_t cw, uint8_t * kk) ++{ ++ uint64_t k[7]; ++ int i, j; ++ ++ k[6] = dvbcsa_load_le64_ecm(ecm, cw); ++ for (i = 6; i > 0; i--) ++ k[i - 1] = dvbcsa_key_permute_block(k[i]); ++ ++ for (i = 0; i < 7; i++) ++ for (j = 0; j < 8; j++) ++ kk[i*8+j] = (k[i]>>(j*8)) ^ i; ++} ++ +diff -uprN ../libdvbcsa-2a1e61e569a621c55c2426f235f42c2398b7f18f-orig/src/dvbcsa_pv.h ./src/dvbcsa_pv.h +--- ../libdvbcsa-2a1e61e569a621c55c2426f235f42c2398b7f18f-orig/src/dvbcsa_pv.h 2018-01-28 13:04:27.000000000 +0000 ++++ ./src/dvbcsa_pv.h 2022-11-27 15:34:26.246312074 +0000 +@@ -88,6 +88,26 @@ struct dvbcsa_key_s + + extern const uint8_t dvbcsa_block_sbox[256]; + ++static const uint8_t csa_block_perm_ecm[256] = ++ { ++ 0x00,0x02,0x80,0x82,0x20,0x22,0xa0,0xa2, 0x04,0x06,0x84,0x86,0x24,0x26,0xa4,0xa6, ++ 0x40,0x42,0xc0,0xc2,0x60,0x62,0xe0,0xe2, 0x44,0x46,0xc4,0xc6,0x64,0x66,0xe4,0xe6, ++ 0x01,0x03,0x81,0x83,0x21,0x23,0xa1,0xa3, 0x05,0x07,0x85,0x87,0x25,0x27,0xa5,0xa7, ++ 0x41,0x43,0xc1,0xc3,0x61,0x63,0xe1,0xe3, 0x45,0x47,0xc5,0xc7,0x65,0x67,0xe5,0xe7, ++ 0x08,0x0a,0x88,0x8a,0x28,0x2a,0xa8,0xaa, 0x0c,0x0e,0x8c,0x8e,0x2c,0x2e,0xac,0xae, ++ 0x48,0x4a,0xc8,0xca,0x68,0x6a,0xe8,0xea, 0x4c,0x4e,0xcc,0xce,0x6c,0x6e,0xec,0xee, ++ 0x09,0x0b,0x89,0x8b,0x29,0x2b,0xa9,0xab, 0x0d,0x0f,0x8d,0x8f,0x2d,0x2f,0xad,0xaf, ++ 0x49,0x4b,0xc9,0xcb,0x69,0x6b,0xe9,0xeb, 0x4d,0x4f,0xcd,0xcf,0x6d,0x6f,0xed,0xef, ++ 0x10,0x12,0x90,0x92,0x30,0x32,0xb0,0xb2, 0x14,0x16,0x94,0x96,0x34,0x36,0xb4,0xb6, ++ 0x50,0x52,0xd0,0xd2,0x70,0x72,0xf0,0xf2, 0x54,0x56,0xd4,0xd6,0x74,0x76,0xf4,0xf6, ++ 0x11,0x13,0x91,0x93,0x31,0x33,0xb1,0xb3, 0x15,0x17,0x95,0x97,0x35,0x37,0xb5,0xb7, ++ 0x51,0x53,0xd1,0xd3,0x71,0x73,0xf1,0xf3, 0x55,0x57,0xd5,0xd7,0x75,0x77,0xf5,0xf7, ++ 0x18,0x1a,0x98,0x9a,0x38,0x3a,0xb8,0xba, 0x1c,0x1e,0x9c,0x9e,0x3c,0x3e,0xbc,0xbe, ++ 0x58,0x5a,0xd8,0xda,0x78,0x7a,0xf8,0xfa, 0x5c,0x5e,0xdc,0xde,0x7c,0x7e,0xfc,0xfe, ++ 0x19,0x1b,0x99,0x9b,0x39,0x3b,0xb9,0xbb, 0x1d,0x1f,0x9d,0x9f,0x3d,0x3f,0xbd,0xbf, ++ 0x59,0x5b,0xd9,0xdb,0x79,0x7b,0xf9,0xfb, 0x5d,0x5f,0xdd,0xdf,0x7d,0x7f,0xfd,0xff ++}; ++ + void dvbcsa_block_decrypt (const dvbcsa_keys_t key, const dvbcsa_block_t in, dvbcsa_block_t out); + void dvbcsa_block_encrypt (const dvbcsa_keys_t key, const dvbcsa_block_t in, dvbcsa_block_t out); + +@@ -95,6 +115,7 @@ void dvbcsa_stream_xor (const dvbcsa_cw_ + uint8_t *stream, unsigned int len); + + void dvbcsa_key_schedule_block(const dvbcsa_cw_t cw, uint8_t * kk); ++void dvbcsa_key_schedule_block_ecm(const unsigned char ecm, const dvbcsa_cw_t cw, uint8_t * kk); + + DVBCSA_INLINE static inline void + dvbcsa_xor_64 (uint8_t *b, const uint8_t *a) +@@ -140,6 +161,33 @@ dvbcsa_load_le64(const uint8_t *p) + ); + #endif + } ++ ++DVBCSA_INLINE static inline uint64_t ++dvbcsa_load_le64_ecm(const unsigned char ecm, const uint8_t *p) ++{ ++ dvbcsa_block_t W; ++ memcpy(W, p, sizeof(W)); ++ if (ecm == 4) ++ { ++ W[0] = csa_block_perm_ecm[p[0]]; ++ W[4] = csa_block_perm_ecm[p[4]]; ++ } ++#if defined(DVBCSA_ENDIAN_LITTLE) ++ uint64_t i; ++ memcpy(&i, W, 8); ++ return i; ++#else ++ return (uint64_t)( ((uint64_t)W[7] << 56) | ++ ((uint64_t)W[6] << 48) | ++ ((uint64_t)W[5] << 40) | ++ ((uint64_t)W[4] << 32) | ++ ((uint64_t)W[3] << 24) | ++ ((uint64_t)W[2] << 16) | ++ ((uint64_t)W[1] << 8 ) | ++ (uint64_t)W[0] ++ ); ++#endif ++} + + DVBCSA_INLINE static inline void + dvbcsa_store_le64(uint8_t *p, const uint64_t w) diff --git a/cross/tvheadend/patches/005-tvh-OSCam-support.patch b/cross/tvheadend/patches/005-tvh-OSCam-support.patch new file mode 100644 index 00000000000..17e9167f00e --- /dev/null +++ b/cross/tvheadend/patches/005-tvh-OSCam-support.patch @@ -0,0 +1,96 @@ +diff -uprN ../tvheadend-52c3ed3ef17eeccddc6a4cf7c0d7151c2823438f-orig/src/descrambler/descrambler.c ./src/descrambler/descrambler.c +--- ../tvheadend-52c3ed3ef17eeccddc6a4cf7c0d7151c2823438f-orig/src/descrambler/descrambler.c 2022-11-10 17:31:18.000000000 +0000 ++++ ./src/descrambler/descrambler.c 2022-11-27 15:34:14.526200847 +0000 +@@ -966,12 +966,12 @@ key_flush( th_descrambler_runtime_t *dr, + /* update the keys */ + if (changed & 1) { + debug2("%p: even key[%d] set for decoder", dr, tk->key_pid); +- tvhcsa_set_key_even(&tk->key_csa, tk->key_data[0]); ++ tvhcsa_set_key_even(&tk->key_csa, tk->key_data[0], dr->dr_ecm); + tk->key_valid |= 0x40; + } + if (changed & 2) { + debug2("%p: odd key[%d] set for decoder", dr, tk->key_pid); +- tvhcsa_set_key_odd(&tk->key_csa, tk->key_data[1]); ++ tvhcsa_set_key_odd(&tk->key_csa, tk->key_data[1], dr->dr_ecm); + tk->key_valid |= 0x80; + } + } +@@ -1371,6 +1371,7 @@ descrambler_table_callback + } + } + } ++ dr->dr_ecm = (ptr[2] - ptr[4]) == 4 ? ptr[0x15] : 0; + tvhtrace(LS_DESCRAMBLER, "ECM message %02x:%02x (section %d, len %d, pid %d) for service \"%s\"", + ptr[0], ptr[1], des->number, len, mt->mt_pid, t->s_dvb_svcname); + } +diff -uprN ../tvheadend-52c3ed3ef17eeccddc6a4cf7c0d7151c2823438f-orig/src/descrambler/descrambler.h ./src/descrambler/descrambler.h +--- ../tvheadend-52c3ed3ef17eeccddc6a4cf7c0d7151c2823438f-orig/src/descrambler/descrambler.h 2022-11-10 17:31:18.000000000 +0000 ++++ ./src/descrambler/descrambler.h 2022-11-27 15:34:14.526200847 +0000 +@@ -103,6 +103,7 @@ typedef struct th_descrambler_runtime { + int64_t dr_ecm_start[2]; + int64_t dr_ecm_last_key_time; + int64_t dr_ecm_key_margin; ++ uint8_t dr_ecm; + int64_t dr_last_err; + int64_t dr_force_skip; + th_descrambler_key_t dr_keys[DESCRAMBLER_MAX_KEYS]; +diff -uprN ../tvheadend-52c3ed3ef17eeccddc6a4cf7c0d7151c2823438f-orig/src/descrambler/tvhcsa.c ./src/descrambler/tvhcsa.c +--- ../tvheadend-52c3ed3ef17eeccddc6a4cf7c0d7151c2823438f-orig/src/descrambler/tvhcsa.c 2022-11-10 17:31:18.000000000 +0000 ++++ ./src/descrambler/tvhcsa.c 2022-11-27 15:34:14.526200847 +0000 +@@ -220,12 +220,12 @@ tvhcsa_set_type( tvhcsa_t *csa, struct m + } + + +-void tvhcsa_set_key_even( tvhcsa_t *csa, const uint8_t *even ) ++void tvhcsa_set_key_even( tvhcsa_t *csa, const uint8_t *even, const uint8_t ecm) + { + switch (csa->csa_type) { + case DESCRAMBLER_CSA_CBC: + #if ENABLE_DVBCSA +- dvbcsa_bs_key_set(even, csa->csa_key_even); ++ dvbcsa_bs_key_set_ecm(ecm, even, csa->csa_key_even); + #endif + break; + case DESCRAMBLER_DES_NCB: +@@ -241,13 +241,13 @@ void tvhcsa_set_key_even( tvhcsa_t *csa, + } + } + +-void tvhcsa_set_key_odd( tvhcsa_t *csa, const uint8_t *odd ) ++void tvhcsa_set_key_odd( tvhcsa_t *csa, const uint8_t *odd, const uint8_t ecm ) + { + assert(csa->csa_type); + switch (csa->csa_type) { + case DESCRAMBLER_CSA_CBC: + #if ENABLE_DVBCSA +- dvbcsa_bs_key_set(odd, csa->csa_key_odd); ++ dvbcsa_bs_key_set_ecm(ecm, odd, csa->csa_key_odd); + #endif + break; + case DESCRAMBLER_DES_NCB: +diff -uprN ../tvheadend-52c3ed3ef17eeccddc6a4cf7c0d7151c2823438f-orig/src/descrambler/tvhcsa.h ./src/descrambler/tvhcsa.h +--- ../tvheadend-52c3ed3ef17eeccddc6a4cf7c0d7151c2823438f-orig/src/descrambler/tvhcsa.h 2022-11-10 17:31:18.000000000 +0000 ++++ ./src/descrambler/tvhcsa.h 2022-11-27 15:34:14.526200847 +0000 +@@ -66,8 +66,8 @@ typedef struct tvhcsa + + int tvhcsa_set_type( tvhcsa_t *csa, struct mpegts_service *s, int type ); + +-void tvhcsa_set_key_even( tvhcsa_t *csa, const uint8_t *even ); +-void tvhcsa_set_key_odd ( tvhcsa_t *csa, const uint8_t *odd ); ++void tvhcsa_set_key_even( tvhcsa_t *csa, const uint8_t *even, const uint8_t ecm ); ++void tvhcsa_set_key_odd ( tvhcsa_t *csa, const uint8_t *odd, const uint8_t ecm ); + + void tvhcsa_init ( tvhcsa_t *csa ); + void tvhcsa_destroy ( tvhcsa_t *csa ); +@@ -76,8 +76,8 @@ void tvhcsa_destroy ( tvhcsa_t *csa ); + + static inline int tvhcsa_set_type( tvhcsa_t *csa, struct mpegts_service *s, int type ) { return -1; } + +-static inline void tvhcsa_set_key_even( tvhcsa_t *csa, const uint8_t *even ) { }; +-static inline void tvhcsa_set_key_odd ( tvhcsa_t *csa, const uint8_t *odd ) { }; ++static inline void tvhcsa_set_key_even( tvhcsa_t *csa, const uint8_t *even, const uint8_t ecm ) { }; ++static inline void tvhcsa_set_key_odd ( tvhcsa_t *csa, const uint8_t *odd, const uint8_t ecm ) { }; + + static inline void tvhcsa_init ( tvhcsa_t *csa ) { }; + static inline void tvhcsa_destroy ( tvhcsa_t *csa ) { }; diff --git a/spk/tvheadend/Makefile b/spk/tvheadend/Makefile index 2a6f9cbf6e8..28418d3500c 100644 --- a/spk/tvheadend/Makefile +++ b/spk/tvheadend/Makefile @@ -4,7 +4,7 @@ SPK_GIT_HASH = 52c3ed3 SPK_GIT_DATE = 20221110 SPK_VERS = $(SPK_SHORT_VERS).$(SPK_GIT_DATE) TVH_VERS = $(SPK_SHORT_VERS)~$(SPK_GIT_HASH) -SPK_REV = 33 +SPK_REV = 34 SPK_ICON = src/tvheadend.png DSM_UI_DIR = app @@ -25,7 +25,7 @@ DESCRIPTION = Tvheadend is a TV streaming server and recorder for Linux, FreeBSD DESCRIPTION_FRE = Tvheadend est un serveur de streaming et enregistreur TV pour Linux, FreeBSD et Android prenant en charge DVB-S, DVB-S2, DVB-C, DVB-T, ATSC, ISDB-T, IPTV, SAT IP et HDHomeRun comme sources d\'entrée. Tvheadend offre le streaming HTTP, HTSP et SAT IP. DISPLAY_NAME = Tvheadend STARTABLE = yes -CHANGELOG = "1. Update to latest git version 52c3ed3 as of November 10th 2022
2. Update openssl to 1.1s
3. Updated to use FFMPEG 4.4.3
4. Updated libhdhomerun to version 20221031
5. iptv_auto: Add support for m3u channel-number tag
6. Include enhanced curl
7. Use newer libdvbcsa with CPU optimizations" +CHANGELOG = "1. Update to latest git version 52c3ed3 as of November 10th 2022
2. Update openssl to 1.1s
3. Updated to use FFMPEG 4.4.3
4. Updated libhdhomerun to version 20221031
5. iptv_auto: Add support for m3u channel-number tag
6. Include enhanced curl
7. Use newer libdvbcsa with CPU optimizations
8. Add OSCam support" HOMEPAGE = https://tvheadend.org/ LICENSE = GPL v3 From 2af09f031e37680b843c30df7507fd77b91bea3e Mon Sep 17 00:00:00 2001 From: Vincent Fortier Date: Sun, 27 Nov 2022 23:41:12 +0000 Subject: [PATCH 3/7] harfbuzz_2: Downgrade from v3 to v2.9.1 as last working version --- cross/{harfbuzz_3 => harfbuzz_2}/Makefile | 3 ++- cross/{harfbuzz_3 => harfbuzz_2}/PLIST | 0 cross/harfbuzz_2/digests | 3 +++ cross/harfbuzz_3/digests | 3 --- cross/libraqm/Makefile | 5 ++--- cross/pango/Makefile | 4 ++-- 6 files changed, 9 insertions(+), 9 deletions(-) rename cross/{harfbuzz_3 => harfbuzz_2}/Makefile (93%) rename cross/{harfbuzz_3 => harfbuzz_2}/PLIST (100%) create mode 100644 cross/harfbuzz_2/digests delete mode 100644 cross/harfbuzz_3/digests diff --git a/cross/harfbuzz_3/Makefile b/cross/harfbuzz_2/Makefile similarity index 93% rename from cross/harfbuzz_3/Makefile rename to cross/harfbuzz_2/Makefile index cccbd30eb1b..b2de72fda23 100644 --- a/cross/harfbuzz_3/Makefile +++ b/cross/harfbuzz_2/Makefile @@ -1,6 +1,7 @@ PKG_NAME = harfbuzz # latest version that can be built with ARMv7 toolchain -PKG_VERS = 3.0.0 +# Not considering v3.x as failing to work with libass +PKG_VERS = 2.9.1 PKG_EXT = tar.xz PKG_DIST_NAME = $(PKG_NAME)-$(PKG_VERS).$(PKG_EXT) PKG_DIST_SITE = https://github.com/harfbuzz/harfbuzz/releases/download/$(PKG_VERS) diff --git a/cross/harfbuzz_3/PLIST b/cross/harfbuzz_2/PLIST similarity index 100% rename from cross/harfbuzz_3/PLIST rename to cross/harfbuzz_2/PLIST diff --git a/cross/harfbuzz_2/digests b/cross/harfbuzz_2/digests new file mode 100644 index 00000000000..d593266ff78 --- /dev/null +++ b/cross/harfbuzz_2/digests @@ -0,0 +1,3 @@ +harfbuzz-2.9.1.tar.xz SHA1 081beab70a8afaed64a71c405b1e65e2f5d5eb40 +harfbuzz-2.9.1.tar.xz SHA256 0edcc980f526a338452180e701d6aba6323aef457b6686976a7d17ccbddc51cf +harfbuzz-2.9.1.tar.xz MD5 f2cec0adcfea1de89b47de4b8e682808 diff --git a/cross/harfbuzz_3/digests b/cross/harfbuzz_3/digests deleted file mode 100644 index 911cb04cbe4..00000000000 --- a/cross/harfbuzz_3/digests +++ /dev/null @@ -1,3 +0,0 @@ -harfbuzz-3.0.0.tar.xz SHA1 be0c3cbaa73854929cee001e9142e1e7bea35165 -harfbuzz-3.0.0.tar.xz SHA256 036b0ee118451539783ec7864148bb4106be42a2eb964df4e83e6703ec46f3d9 -harfbuzz-3.0.0.tar.xz MD5 ae9bf986e12840ebe4e19c8106fd16bf diff --git a/cross/libraqm/Makefile b/cross/libraqm/Makefile index 5536714b03a..67b7777ffea 100644 --- a/cross/libraqm/Makefile +++ b/cross/libraqm/Makefile @@ -6,18 +6,17 @@ PKG_DIST_SITE = https://github.com/HOST-Oman/libraqm/releases/download/v$(PKG_VE PKG_DIR = raqm-$(PKG_VERS) DEPENDS = cross/freetype cross/fribidi -OPTIONAL_DEPENDS = cross/harfbuzz cross/harfbuzz_3 +OPTIONAL_DEPENDS = cross/harfbuzz cross/harfbuzz_2 # harfbuzz UNSUPPORTED_ARCHS = $(ARMv5_ARCHS) $(OLD_PPC_ARCHS) include ../../mk/spksrc.archs.mk ifeq ($(findstring $(ARCH),$(ARMv7L_ARCHS)),$(ARCH)) -DEPENDS += cross/harfbuzz_3 +DEPENDS += cross/harfbuzz_2 else DEPENDS += cross/harfbuzz endif - HOMEPAGE = https://host-oman.github.io/libraqm/ COMMENT = Raqm is a small library that encapsulates the logic for complex text layout and provides a convenient API. LICENSE = MIT diff --git a/cross/pango/Makefile b/cross/pango/Makefile index 2c8a00cfd0f..c4a64f6e8d2 100644 --- a/cross/pango/Makefile +++ b/cross/pango/Makefile @@ -7,13 +7,13 @@ PKG_DIST_FILE = $(PKG_NAME)-$(PKG_VERS).$(PKG_EXT) PKG_DIR = $(PKG_NAME)-$(PKG_VERS) DEPENDS = cross/fontconfig cross/cairo cross/glib -OPTIONAL_DEPENDS = cross/harfbuzz cross/harfbuzz_3 +OPTIONAL_DEPENDS = cross/harfbuzz cross/harfbuzz_2 include ../../mk/spksrc.archs.mk ifneq ($(findstring $(ARCH),$(ARMv5_ARCHS) $(OLD_PPC_ARCHS)),$(ARCH)) # REMARKS: we must build glib before harfbuzz to get harbuzz glib integration (hb-glib.h) ifeq ($(findstring $(ARCH),$(ARMv7L_ARCHS)),$(ARCH)) -DEPENDS += cross/harfbuzz_3 +DEPENDS += cross/harfbuzz_2 else DEPENDS += cross/harfbuzz endif From 466b33e38aac9a413314d295b18a267d7bcfb648 Mon Sep 17 00:00:00 2001 From: Vincent Fortier Date: Sun, 27 Nov 2022 23:41:39 +0000 Subject: [PATCH 4/7] libass: Re-enable libass for ARMv7L using harfbuzz 2.9.1 --- cross/ffmpeg/Makefile | 4 ++-- cross/libass/Makefile | 12 +++++++++++- spk/ffmpeg/Makefile | 2 +- 3 files changed, 14 insertions(+), 4 deletions(-) diff --git a/cross/ffmpeg/Makefile b/cross/ffmpeg/Makefile index fbe6ceb2b2c..3664be95902 100644 --- a/cross/ffmpeg/Makefile +++ b/cross/ffmpeg/Makefile @@ -167,8 +167,8 @@ DEPENDS += cross/fdk-aac CONFIGURE_ARGS += --enable-libfdk-aac --enable-nonfree ifeq ($(call version_lt, ${TCVERSION}, 7.0),1) -ifneq ($(findstring $(ARCH),$(ARMv5_ARCHS) $(ARMv7L_ARCHS) $(OLD_PPC_ARCHS)),$(ARCH)) -# Newer libass requires harfbuzz which in turns requires c++ from gcc >= 4.9 (88f6281-6.1 = gcc-4.6.4) +ifneq ($(findstring $(ARCH),$(ARMv5_ARCHS) $(OLD_PPC_ARCHS)),$(ARCH)) +# libass requires harfbuzz which in turns requires c++ from gcc >= 4.8 (88f6281-6.1 = gcc-4.6.4) DEPENDS += cross/libass CONFIGURE_ARGS += --enable-libass endif diff --git a/cross/libass/Makefile b/cross/libass/Makefile index b5025ef3951..aa543c773e0 100644 --- a/cross/libass/Makefile +++ b/cross/libass/Makefile @@ -5,7 +5,17 @@ PKG_DIST_NAME = $(PKG_NAME)-$(PKG_VERS).$(PKG_EXT) PKG_DIST_SITE = https://github.com/libass/libass/releases/download/$(PKG_VERS) PKG_DIR = $(PKG_NAME)-$(PKG_VERS) -DEPENDS = cross/freetype cross/fribidi cross/fontconfig cross/harfbuzz +DEPENDS = cross/freetype cross/fribidi cross/fontconfig +OPTIONAL_DEPENDS = cross/harfbuzz cross/harfbuzz_2 + +# harfbuzz +UNSUPPORTED_ARCHS = $(ARMv5_ARCHS) $(OLD_PPC_ARCHS) +include ../../mk/spksrc.archs.mk +ifeq ($(findstring $(ARCH),$(ARMv7L_ARCHS)),$(ARCH)) +DEPENDS += cross/harfbuzz_2 +else +DEPENDS += cross/harfbuzz +endif HOMEPAGE = https://github.com/libass/libass COMMENT = libass is a portable subtitle renderer for the ASS/SSA (Advanced Substation Alpha/Substation Alpha) subtitle format. diff --git a/spk/ffmpeg/Makefile b/spk/ffmpeg/Makefile index a227598211c..5e2cd1e3aad 100644 --- a/spk/ffmpeg/Makefile +++ b/spk/ffmpeg/Makefile @@ -2,7 +2,7 @@ SPK_NAME = ffmpeg SPK_VERS = 4.4.3 SPK_REV = 47 SPK_ICON = src/ffmpeg.png -CHANGELOG = "1. Update to FFMPEG 4.4.3
2. Update Intel Media Driver 2022Q3 Release - 22.5.4
3. Fix ppc x265 librarie issue \#5314
5. Update libaom to version 3.5
6. Multiple dependency updates" +CHANGELOG = "1. Update to FFMPEG 4.4.3
2. Update Intel Media Driver 2022Q3 Release - 22.5.4
3. Fix ppc x265 librarie issue \#5314
5. Update libaom to version 3.5
6. Multiple dependency updates
7. Restore libass for ARMv7L" CONF_DIR = src/conf From 799b6eefa1abd15eec6fcb9ad2f6c61da36152cd Mon Sep 17 00:00:00 2001 From: Vincent Fortier Date: Mon, 28 Nov 2022 12:06:51 +0000 Subject: [PATCH 5/7] harfbuzz_2: Forgot to update PLIST (thnx @hgy59) --- cross/harfbuzz_2/PLIST | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/cross/harfbuzz_2/PLIST b/cross/harfbuzz_2/PLIST index c40652b8b98..6f6108a5270 100644 --- a/cross/harfbuzz_2/PLIST +++ b/cross/harfbuzz_2/PLIST @@ -1,9 +1,9 @@ lnk:lib/libharfbuzz-gobject.so lnk:lib/libharfbuzz-gobject.so.0 -lib:lib/libharfbuzz-gobject.so.0.30000.0 +lib:lib/libharfbuzz-gobject.so.0.20901.0 lnk:lib/libharfbuzz-subset.so lnk:lib/libharfbuzz-subset.so.0 -lib:lib/libharfbuzz-subset.so.0.30000.0 +lib:lib/libharfbuzz-subset.so.0.20901.0 lnk:lib/libharfbuzz.so lnk:lib/libharfbuzz.so.0 -lib:lib/libharfbuzz.so.0.30000.0 +lib:lib/libharfbuzz.so.0.20901.0 From 4ea8c6b9570b35ad08f713b0242bb9bd3753dc82 Mon Sep 17 00:00:00 2001 From: Vincent Fortier Date: Mon, 28 Nov 2022 12:09:34 +0000 Subject: [PATCH 6/7] libdvbcsa: Update to v2 of the patchset used as-is (PATCH_LVL=1) --- cross/libdvbcsa/Makefile | 1 + .../patches/001-libdvbcsa-OSCam-support.patch | 149 -------------- .../001-libdvbcsa-OSCam-support_v2.patch | 181 ++++++++++++++++++ 3 files changed, 182 insertions(+), 149 deletions(-) delete mode 100644 cross/libdvbcsa/patches/001-libdvbcsa-OSCam-support.patch create mode 100644 cross/libdvbcsa/patches/001-libdvbcsa-OSCam-support_v2.patch diff --git a/cross/libdvbcsa/Makefile b/cross/libdvbcsa/Makefile index fec37ebbf58..9ae2a731c78 100644 --- a/cross/libdvbcsa/Makefile +++ b/cross/libdvbcsa/Makefile @@ -19,6 +19,7 @@ CONFIGURE_ARGS = --enable-shared CONFIGURE_ARGS += --prefix=$(INSTALL_PREFIX) PRE_CONFIGURE_TARGET = libdvbcsa_pre_configure +PATCHES_LEVEL = 1 ifeq ($(findstring $(ARCH),$(ARMv7_ARCHS) $(ARMv7L_ARCHS) $(ARMv8_ARCHS)),$(ARCH)) CONFIGURE_ARGS += --enable-neon diff --git a/cross/libdvbcsa/patches/001-libdvbcsa-OSCam-support.patch b/cross/libdvbcsa/patches/001-libdvbcsa-OSCam-support.patch deleted file mode 100644 index ea878b9034b..00000000000 --- a/cross/libdvbcsa/patches/001-libdvbcsa-OSCam-support.patch +++ /dev/null @@ -1,149 +0,0 @@ -diff -uprN ../libdvbcsa-2a1e61e569a621c55c2426f235f42c2398b7f18f-orig/src/dvbcsa/dvbcsa.h ./src/dvbcsa/dvbcsa.h ---- ../libdvbcsa-2a1e61e569a621c55c2426f235f42c2398b7f18f-orig/src/dvbcsa/dvbcsa.h 2018-01-28 13:04:27.000000000 +0000 -+++ ./src/dvbcsa/dvbcsa.h 2022-11-27 15:34:26.246312074 +0000 -@@ -93,6 +93,8 @@ void dvbcsa_bs_key_free(struct dvbcsa_bs - - void dvbcsa_bs_key_set(const dvbcsa_cw_t cw, struct dvbcsa_bs_key_s *key); - -+void dvbcsa_bs_key_set_ecm(const unsigned char ecm, const dvbcsa_cw_t cw, struct dvbcsa_bs_key_s *key); -+ - /** get maximum number of packet per batch */ - - unsigned int dvbcsa_bs_batch_size(void); -diff -uprN ../libdvbcsa-2a1e61e569a621c55c2426f235f42c2398b7f18f-orig/src/dvbcsa_bs_key.c ./src/dvbcsa_bs_key.c ---- ../libdvbcsa-2a1e61e569a621c55c2426f235f42c2398b7f18f-orig/src/dvbcsa_bs_key.c 2018-01-28 13:04:27.000000000 +0000 -+++ ./src/dvbcsa_bs_key.c 2022-11-27 15:34:26.246312074 +0000 -@@ -63,3 +63,39 @@ dvbcsa_bs_key_set (const dvbcsa_cw_t cw, - } - } - -+void -+dvbcsa_bs_key_set_ecm (const unsigned char ecm, const dvbcsa_cw_t cw, struct dvbcsa_bs_key_s *key) -+{ -+ dvbcsa_keys_t kk; -+ int i; -+ -+ /* precalculations for stream */ -+ -+ uint64_t ck = dvbcsa_load_le64(cw); -+ -+ for (i = 0; i < DVBCSA_CWBITS_SIZE; i++) -+ key->stream[i] = (ck >> (i^4)) & 1 ? BS_VAL8(ff) : BS_VAL8(00); -+ -+ /* precalculations for block */ -+ -+ dvbcsa_key_schedule_block_ecm(ecm, cw, kk); -+ -+ for (i = 0; i < DVBCSA_KEYSBUFF_SIZE; i++) -+ { -+#if BS_BATCH_SIZE == 32 -+ *(dvbcsa_u32_aliasing_t *)(key->block + i) = kk[i] * 0x01010101; -+ -+#elif BS_BATCH_SIZE == 64 -+ *(dvbcsa_u64_aliasing_t *)(key->block + i) = kk[i] * 0x0101010101010101ULL; -+ -+#elif BS_BATCH_SIZE > 64 && BS_BATCH_SIZE % 64 == 0 -+ uint64_t v = kk[i] * 0x0101010101010101ULL; -+ int j; -+ -+ for (j = 0; j < BS_BATCH_BYTES / 8; j++) -+ *((dvbcsa_u64_aliasing_t *)(key->block + i) + j) = v; -+#else -+# error -+#endif -+ } -+} -diff -uprN ../libdvbcsa-2a1e61e569a621c55c2426f235f42c2398b7f18f-orig/src/dvbcsa_key.c ./src/dvbcsa_key.c ---- ../libdvbcsa-2a1e61e569a621c55c2426f235f42c2398b7f18f-orig/src/dvbcsa_key.c 2018-01-28 13:04:27.000000000 +0000 -+++ ./src/dvbcsa_key.c 2022-11-27 15:34:26.246312074 +0000 -@@ -585,3 +585,18 @@ dvbcsa_key_schedule_block(const dvbcsa_c - kk[i*8+j] = (k[i]>>(j*8)) ^ i; - } - -+void -+dvbcsa_key_schedule_block_ecm(const unsigned char ecm, const dvbcsa_cw_t cw, uint8_t * kk) -+{ -+ uint64_t k[7]; -+ int i, j; -+ -+ k[6] = dvbcsa_load_le64_ecm(ecm, cw); -+ for (i = 6; i > 0; i--) -+ k[i - 1] = dvbcsa_key_permute_block(k[i]); -+ -+ for (i = 0; i < 7; i++) -+ for (j = 0; j < 8; j++) -+ kk[i*8+j] = (k[i]>>(j*8)) ^ i; -+} -+ -diff -uprN ../libdvbcsa-2a1e61e569a621c55c2426f235f42c2398b7f18f-orig/src/dvbcsa_pv.h ./src/dvbcsa_pv.h ---- ../libdvbcsa-2a1e61e569a621c55c2426f235f42c2398b7f18f-orig/src/dvbcsa_pv.h 2018-01-28 13:04:27.000000000 +0000 -+++ ./src/dvbcsa_pv.h 2022-11-27 15:34:26.246312074 +0000 -@@ -88,6 +88,26 @@ struct dvbcsa_key_s - - extern const uint8_t dvbcsa_block_sbox[256]; - -+static const uint8_t csa_block_perm_ecm[256] = -+ { -+ 0x00,0x02,0x80,0x82,0x20,0x22,0xa0,0xa2, 0x04,0x06,0x84,0x86,0x24,0x26,0xa4,0xa6, -+ 0x40,0x42,0xc0,0xc2,0x60,0x62,0xe0,0xe2, 0x44,0x46,0xc4,0xc6,0x64,0x66,0xe4,0xe6, -+ 0x01,0x03,0x81,0x83,0x21,0x23,0xa1,0xa3, 0x05,0x07,0x85,0x87,0x25,0x27,0xa5,0xa7, -+ 0x41,0x43,0xc1,0xc3,0x61,0x63,0xe1,0xe3, 0x45,0x47,0xc5,0xc7,0x65,0x67,0xe5,0xe7, -+ 0x08,0x0a,0x88,0x8a,0x28,0x2a,0xa8,0xaa, 0x0c,0x0e,0x8c,0x8e,0x2c,0x2e,0xac,0xae, -+ 0x48,0x4a,0xc8,0xca,0x68,0x6a,0xe8,0xea, 0x4c,0x4e,0xcc,0xce,0x6c,0x6e,0xec,0xee, -+ 0x09,0x0b,0x89,0x8b,0x29,0x2b,0xa9,0xab, 0x0d,0x0f,0x8d,0x8f,0x2d,0x2f,0xad,0xaf, -+ 0x49,0x4b,0xc9,0xcb,0x69,0x6b,0xe9,0xeb, 0x4d,0x4f,0xcd,0xcf,0x6d,0x6f,0xed,0xef, -+ 0x10,0x12,0x90,0x92,0x30,0x32,0xb0,0xb2, 0x14,0x16,0x94,0x96,0x34,0x36,0xb4,0xb6, -+ 0x50,0x52,0xd0,0xd2,0x70,0x72,0xf0,0xf2, 0x54,0x56,0xd4,0xd6,0x74,0x76,0xf4,0xf6, -+ 0x11,0x13,0x91,0x93,0x31,0x33,0xb1,0xb3, 0x15,0x17,0x95,0x97,0x35,0x37,0xb5,0xb7, -+ 0x51,0x53,0xd1,0xd3,0x71,0x73,0xf1,0xf3, 0x55,0x57,0xd5,0xd7,0x75,0x77,0xf5,0xf7, -+ 0x18,0x1a,0x98,0x9a,0x38,0x3a,0xb8,0xba, 0x1c,0x1e,0x9c,0x9e,0x3c,0x3e,0xbc,0xbe, -+ 0x58,0x5a,0xd8,0xda,0x78,0x7a,0xf8,0xfa, 0x5c,0x5e,0xdc,0xde,0x7c,0x7e,0xfc,0xfe, -+ 0x19,0x1b,0x99,0x9b,0x39,0x3b,0xb9,0xbb, 0x1d,0x1f,0x9d,0x9f,0x3d,0x3f,0xbd,0xbf, -+ 0x59,0x5b,0xd9,0xdb,0x79,0x7b,0xf9,0xfb, 0x5d,0x5f,0xdd,0xdf,0x7d,0x7f,0xfd,0xff -+}; -+ - void dvbcsa_block_decrypt (const dvbcsa_keys_t key, const dvbcsa_block_t in, dvbcsa_block_t out); - void dvbcsa_block_encrypt (const dvbcsa_keys_t key, const dvbcsa_block_t in, dvbcsa_block_t out); - -@@ -95,6 +115,7 @@ void dvbcsa_stream_xor (const dvbcsa_cw_ - uint8_t *stream, unsigned int len); - - void dvbcsa_key_schedule_block(const dvbcsa_cw_t cw, uint8_t * kk); -+void dvbcsa_key_schedule_block_ecm(const unsigned char ecm, const dvbcsa_cw_t cw, uint8_t * kk); - - DVBCSA_INLINE static inline void - dvbcsa_xor_64 (uint8_t *b, const uint8_t *a) -@@ -140,6 +161,33 @@ dvbcsa_load_le64(const uint8_t *p) - ); - #endif - } -+ -+DVBCSA_INLINE static inline uint64_t -+dvbcsa_load_le64_ecm(const unsigned char ecm, const uint8_t *p) -+{ -+ dvbcsa_block_t W; -+ memcpy(W, p, sizeof(W)); -+ if (ecm == 4) -+ { -+ W[0] = csa_block_perm_ecm[p[0]]; -+ W[4] = csa_block_perm_ecm[p[4]]; -+ } -+#if defined(DVBCSA_ENDIAN_LITTLE) -+ uint64_t i; -+ memcpy(&i, W, 8); -+ return i; -+#else -+ return (uint64_t)( ((uint64_t)W[7] << 56) | -+ ((uint64_t)W[6] << 48) | -+ ((uint64_t)W[5] << 40) | -+ ((uint64_t)W[4] << 32) | -+ ((uint64_t)W[3] << 24) | -+ ((uint64_t)W[2] << 16) | -+ ((uint64_t)W[1] << 8 ) | -+ (uint64_t)W[0] -+ ); -+#endif -+} - - DVBCSA_INLINE static inline void - dvbcsa_store_le64(uint8_t *p, const uint64_t w) diff --git a/cross/libdvbcsa/patches/001-libdvbcsa-OSCam-support_v2.patch b/cross/libdvbcsa/patches/001-libdvbcsa-OSCam-support_v2.patch new file mode 100644 index 00000000000..3b235573a83 --- /dev/null +++ b/cross/libdvbcsa/patches/001-libdvbcsa-OSCam-support_v2.patch @@ -0,0 +1,181 @@ +diff --git a/README b/README +index f480e67..f41b865 100644 +--- a/README ++++ b/README +@@ -135,6 +135,12 @@ Example: + dvbcsa_bs_encrypt(key, b, 184); + + ++ DVBCSA_KEY_ECM ++ ++ unsigned char ecm = (ecm_caid >> 8 == 0x09 && (ecm_data[2] - ecm_data[4]) == 4) ? ecm_data[21] : 0; ++ dvbcsa_bs_key_set_ecm(ecm, cw, key); ++ ++ + Portability + =========== + +diff --git a/src/dvbcsa/dvbcsa.h b/src/dvbcsa/dvbcsa.h +index c7e9c59..4c37414 100644 +--- a/src/dvbcsa/dvbcsa.h ++++ b/src/dvbcsa/dvbcsa.h +@@ -93,6 +93,10 @@ void dvbcsa_bs_key_free(struct dvbcsa_bs_key_s *key); + + void dvbcsa_bs_key_set(const dvbcsa_cw_t cw, struct dvbcsa_bs_key_s *key); + ++#ifndef DVBCSA_KEY_ECM ++#define DVBCSA_KEY_ECM 1 ++void dvbcsa_bs_key_set_ecm(const unsigned char ecm, const dvbcsa_cw_t cw, struct dvbcsa_bs_key_s *key); ++#endif + /** get maximum number of packet per batch */ + + unsigned int dvbcsa_bs_batch_size(void); +diff --git a/src/dvbcsa_bs_key.c b/src/dvbcsa_bs_key.c +index e2fcf55..4c5570b 100644 +--- a/src/dvbcsa_bs_key.c ++++ b/src/dvbcsa_bs_key.c +@@ -63,3 +63,41 @@ dvbcsa_bs_key_set (const dvbcsa_cw_t cw, struct dvbcsa_bs_key_s *key) + } + } + ++#if DVBCSA_KEY_ECM > 0 ++void ++dvbcsa_bs_key_set_ecm (const unsigned char ecm, const dvbcsa_cw_t cw, struct dvbcsa_bs_key_s *key) ++{ ++ dvbcsa_keys_t kk; ++ int i; ++ ++ /* precalculations for stream */ ++ ++ uint64_t ck = dvbcsa_load_le64(cw); ++ ++ for (i = 0; i < DVBCSA_CWBITS_SIZE; i++) ++ key->stream[i] = (ck >> (i^4)) & 1 ? BS_VAL8(ff) : BS_VAL8(00); ++ ++ /* precalculations for block */ ++ ++ dvbcsa_key_schedule_block_ecm(ecm, cw, kk); ++ ++ for (i = 0; i < DVBCSA_KEYSBUFF_SIZE; i++) ++ { ++#if BS_BATCH_SIZE == 32 ++ *(dvbcsa_u32_aliasing_t *)(key->block + i) = kk[i] * 0x01010101; ++ ++#elif BS_BATCH_SIZE == 64 ++ *(dvbcsa_u64_aliasing_t *)(key->block + i) = kk[i] * 0x0101010101010101ULL; ++ ++#elif BS_BATCH_SIZE > 64 && BS_BATCH_SIZE % 64 == 0 ++ uint64_t v = kk[i] * 0x0101010101010101ULL; ++ int j; ++ ++ for (j = 0; j < BS_BATCH_BYTES / 8; j++) ++ *((dvbcsa_u64_aliasing_t *)(key->block + i) + j) = v; ++#else ++# error ++#endif ++ } ++} ++#endif +diff --git a/src/dvbcsa_key.c b/src/dvbcsa_key.c +index 1ff17e0..70e7d7e 100644 +--- a/src/dvbcsa_key.c ++++ b/src/dvbcsa_key.c +@@ -585,3 +585,20 @@ dvbcsa_key_schedule_block(const dvbcsa_cw_t cw, uint8_t * kk) + kk[i*8+j] = (k[i]>>(j*8)) ^ i; + } + ++#if DVBCSA_KEY_ECM > 0 ++void ++dvbcsa_key_schedule_block_ecm(const unsigned char ecm, const dvbcsa_cw_t cw, uint8_t * kk) ++{ ++ uint64_t k[7]; ++ int i, j; ++ ++ k[6] = dvbcsa_load_le64_ecm(ecm, cw); ++ for (i = 6; i > 0; i--) ++ k[i - 1] = dvbcsa_key_permute_block(k[i]); ++ ++ for (i = 0; i < 7; i++) ++ for (j = 0; j < 8; j++) ++ kk[i*8+j] = (k[i]>>(j*8)) ^ i; ++} ++#endif ++ +diff --git a/src/dvbcsa_pv.h b/src/dvbcsa_pv.h +index 83753b1..d4205ab 100644 +--- a/src/dvbcsa_pv.h ++++ b/src/dvbcsa_pv.h +@@ -87,6 +87,27 @@ struct dvbcsa_key_s + }; + + extern const uint8_t dvbcsa_block_sbox[256]; ++#if DVBCSA_KEY_ECM > 0 ++static const uint8_t csa_block_perm_ecm[256] = ++{ ++ 0x00, 0x02, 0x80, 0x82, 0x20, 0x22, 0xa0, 0xa2, 0x04, 0x06, 0x84, 0x86, 0x24, 0x26, 0xa4, 0xa6, ++ 0x40, 0x42, 0xc0, 0xc2, 0x60, 0x62, 0xe0, 0xe2, 0x44, 0x46, 0xc4, 0xc6, 0x64, 0x66, 0xe4, 0xe6, ++ 0x01, 0x03, 0x81, 0x83, 0x21, 0x23, 0xa1, 0xa3, 0x05, 0x07, 0x85, 0x87, 0x25, 0x27, 0xa5, 0xa7, ++ 0x41, 0x43, 0xc1, 0xc3, 0x61, 0x63, 0xe1, 0xe3, 0x45, 0x47, 0xc5, 0xc7, 0x65, 0x67, 0xe5, 0xe7, ++ 0x08, 0x0a, 0x88, 0x8a, 0x28, 0x2a, 0xa8, 0xaa, 0x0c, 0x0e, 0x8c, 0x8e, 0x2c, 0x2e, 0xac, 0xae, ++ 0x48, 0x4a, 0xc8, 0xca, 0x68, 0x6a, 0xe8, 0xea, 0x4c, 0x4e, 0xcc, 0xce, 0x6c, 0x6e, 0xec, 0xee, ++ 0x09, 0x0b, 0x89, 0x8b, 0x29, 0x2b, 0xa9, 0xab, 0x0d, 0x0f, 0x8d, 0x8f, 0x2d, 0x2f, 0xad, 0xaf, ++ 0x49, 0x4b, 0xc9, 0xcb, 0x69, 0x6b, 0xe9, 0xeb, 0x4d, 0x4f, 0xcd, 0xcf, 0x6d, 0x6f, 0xed, 0xef, ++ 0x10, 0x12, 0x90, 0x92, 0x30, 0x32, 0xb0, 0xb2, 0x14, 0x16, 0x94, 0x96, 0x34, 0x36, 0xb4, 0xb6, ++ 0x50, 0x52, 0xd0, 0xd2, 0x70, 0x72, 0xf0, 0xf2, 0x54, 0x56, 0xd4, 0xd6, 0x74, 0x76, 0xf4, 0xf6, ++ 0x11, 0x13, 0x91, 0x93, 0x31, 0x33, 0xb1, 0xb3, 0x15, 0x17, 0x95, 0x97, 0x35, 0x37, 0xb5, 0xb7, ++ 0x51, 0x53, 0xd1, 0xd3, 0x71, 0x73, 0xf1, 0xf3, 0x55, 0x57, 0xd5, 0xd7, 0x75, 0x77, 0xf5, 0xf7, ++ 0x18, 0x1a, 0x98, 0x9a, 0x38, 0x3a, 0xb8, 0xba, 0x1c, 0x1e, 0x9c, 0x9e, 0x3c, 0x3e, 0xbc, 0xbe, ++ 0x58, 0x5a, 0xd8, 0xda, 0x78, 0x7a, 0xf8, 0xfa, 0x5c, 0x5e, 0xdc, 0xde, 0x7c, 0x7e, 0xfc, 0xfe, ++ 0x19, 0x1b, 0x99, 0x9b, 0x39, 0x3b, 0xb9, 0xbb, 0x1d, 0x1f, 0x9d, 0x9f, 0x3d, 0x3f, 0xbd, 0xbf, ++ 0x59, 0x5b, 0xd9, 0xdb, 0x79, 0x7b, 0xf9, 0xfb, 0x5d, 0x5f, 0xdd, 0xdf, 0x7d, 0x7f, 0xfd, 0xff ++}; ++#endif + + void dvbcsa_block_decrypt (const dvbcsa_keys_t key, const dvbcsa_block_t in, dvbcsa_block_t out); + void dvbcsa_block_encrypt (const dvbcsa_keys_t key, const dvbcsa_block_t in, dvbcsa_block_t out); +@@ -95,6 +116,9 @@ void dvbcsa_stream_xor (const dvbcsa_cw_t cw, const dvbcsa_block_t iv, + uint8_t *stream, unsigned int len); + + void dvbcsa_key_schedule_block(const dvbcsa_cw_t cw, uint8_t * kk); ++#if DVBCSA_KEY_ECM > 0 ++void dvbcsa_key_schedule_block_ecm(const unsigned char ecm, const dvbcsa_cw_t cw, uint8_t * kk); ++#endif + + DVBCSA_INLINE static inline void + dvbcsa_xor_64 (uint8_t *b, const uint8_t *a) +@@ -141,6 +165,35 @@ dvbcsa_load_le64(const uint8_t *p) + #endif + } + ++#if DVBCSA_KEY_ECM > 0 ++DVBCSA_INLINE static inline uint64_t ++dvbcsa_load_le64_ecm(const unsigned char ecm, const uint8_t *p) ++{ ++ dvbcsa_block_t W; ++ memcpy(W, p, sizeof(W)); ++ if (ecm == 4) ++ { ++ W[0] = csa_block_perm_ecm[p[0]]; ++ W[4] = csa_block_perm_ecm[p[4]]; ++ } ++#if defined(DVBCSA_ENDIAN_LITTLE) ++ uint64_t i; ++ memcpy(&i, W, 8); ++ return i; ++#else ++ return (uint64_t)( ((uint64_t)W[7] << 56) | ++ ((uint64_t)W[6] << 48) | ++ ((uint64_t)W[5] << 40) | ++ ((uint64_t)W[4] << 32) | ++ ((uint64_t)W[3] << 24) | ++ ((uint64_t)W[2] << 16) | ++ ((uint64_t)W[1] << 8 ) | ++ (uint64_t)W[0] ++ ); ++#endif ++} ++# endif ++ + DVBCSA_INLINE static inline void + dvbcsa_store_le64(uint8_t *p, const uint64_t w) + { From ffa41b4a8307d81f8dffeb17622c1473e911bb9f Mon Sep 17 00:00:00 2001 From: Vincent Fortier Date: Tue, 29 Nov 2022 01:36:03 +0000 Subject: [PATCH 7/7] tvheadend: Update to version 4.3 git hash d885496 from Nov 28th --- cross/tvheadend/Makefile | 15 ++++++++++----- cross/tvheadend/digests | 6 +++--- spk/tvheadend/Makefile | 6 +++--- 3 files changed, 16 insertions(+), 11 deletions(-) diff --git a/cross/tvheadend/Makefile b/cross/tvheadend/Makefile index 5f3e6801793..26f3e568e4c 100644 --- a/cross/tvheadend/Makefile +++ b/cross/tvheadend/Makefile @@ -1,8 +1,8 @@ PKG_NAME = tvheadend PKG_VERS = 4.3 PKG_EXT = tar.gz -# git hash from November 10th 2022 -PKG_GIT_HASH = 52c3ed3ef17eeccddc6a4cf7c0d7151c2823438f +# git hash from November 28th 2022 +PKG_GIT_HASH = d8854960361b0fb6846f0912f509dfad61f3ccbf PKG_DIST_NAME = $(PKG_GIT_HASH).$(PKG_EXT) PKG_DIST_SITE = https://github.com/tvheadend/tvheadend/archive PKG_DIST_FILE = $(PKG_NAME)-git$(PKG_GIT_HASH).$(PKG_EXT) @@ -48,12 +48,15 @@ ifeq ($(wildcard $(FFMPEG_DIR)),) DEPENDS += cross/ffmpeg endif -include ../../mk/spksrc.cross-cc.mk - -ifeq ($(call version_lt, $(TC_GCC), 5.0),1) +ifeq ($(call version_ge, ${TCVERSION}, 7.0),1) +ADDITIONAL_CFLAGS += -std=gnu11 +else CONFIGURE_ARGS += --nowerror +ADDITIONAL_CFLAGS += -std=gnu99 endif +include ../../mk/spksrc.common.mk + ifeq ($(findstring $(ARCH),$(x64_ARCHS)),$(ARCH)) CONFIGURE_ARGS += --enable-vaapi ifeq ($(wildcard $(FFMPEG_DIR)),) @@ -61,6 +64,8 @@ DEPENDS += cross/libva endif endif +include ../../mk/spksrc.cross-cc.mk + .PHONY: tvheadend_pre_configure tvheadend_pre_configure: # Fix so mkbundle finds the pngquant binary diff --git a/cross/tvheadend/digests b/cross/tvheadend/digests index 83552f4d1cf..e85d0da5323 100644 --- a/cross/tvheadend/digests +++ b/cross/tvheadend/digests @@ -1,3 +1,3 @@ -tvheadend-git52c3ed3ef17eeccddc6a4cf7c0d7151c2823438f.tar.gz SHA1 aaa5235fa5eabacfc1d647ff31febfe3674f151a -tvheadend-git52c3ed3ef17eeccddc6a4cf7c0d7151c2823438f.tar.gz SHA256 7602af0481481e112435cedf8f148eb18f2f3e67b169973946edb7f6cbf02e6f -tvheadend-git52c3ed3ef17eeccddc6a4cf7c0d7151c2823438f.tar.gz MD5 db678d1e6856ed7c4986398ba3361a99 +tvheadend-gitd8854960361b0fb6846f0912f509dfad61f3ccbf.tar.gz SHA1 19923b760f08548272bb279b0bccdcfcae7dcc51 +tvheadend-gitd8854960361b0fb6846f0912f509dfad61f3ccbf.tar.gz SHA256 91a7c27230d8413d4cc84f5470feb55f9f930ed29a727b91daee1ebae7c254be +tvheadend-gitd8854960361b0fb6846f0912f509dfad61f3ccbf.tar.gz MD5 b58f9f2d0c8c889d3028bfcbf456704f diff --git a/spk/tvheadend/Makefile b/spk/tvheadend/Makefile index 28418d3500c..46379153223 100644 --- a/spk/tvheadend/Makefile +++ b/spk/tvheadend/Makefile @@ -1,7 +1,7 @@ SPK_NAME = tvheadend SPK_SHORT_VERS = 4.3 -SPK_GIT_HASH = 52c3ed3 -SPK_GIT_DATE = 20221110 +SPK_GIT_HASH = d885496 +SPK_GIT_DATE = 20221128 SPK_VERS = $(SPK_SHORT_VERS).$(SPK_GIT_DATE) TVH_VERS = $(SPK_SHORT_VERS)~$(SPK_GIT_HASH) SPK_REV = 34 @@ -25,7 +25,7 @@ DESCRIPTION = Tvheadend is a TV streaming server and recorder for Linux, FreeBSD DESCRIPTION_FRE = Tvheadend est un serveur de streaming et enregistreur TV pour Linux, FreeBSD et Android prenant en charge DVB-S, DVB-S2, DVB-C, DVB-T, ATSC, ISDB-T, IPTV, SAT IP et HDHomeRun comme sources d\'entrée. Tvheadend offre le streaming HTTP, HTSP et SAT IP. DISPLAY_NAME = Tvheadend STARTABLE = yes -CHANGELOG = "1. Update to latest git version 52c3ed3 as of November 10th 2022
2. Update openssl to 1.1s
3. Updated to use FFMPEG 4.4.3
4. Updated libhdhomerun to version 20221031
5. iptv_auto: Add support for m3u channel-number tag
6. Include enhanced curl
7. Use newer libdvbcsa with CPU optimizations
8. Add OSCam support" +CHANGELOG = "1. Update to latest git version d885496 as of November 28th 2022
2. Update openssl to 1.1.1s
3. Updated to use FFMPEG 4.4.3
4. Updated libhdhomerun to version 20221031
5. iptv_auto: Add support for m3u channel-number tag with HDhomeRun
6. Include enhanced curl
7. Use newer libdvbcsa with CPU optimizations
8. Add OSCam support" HOMEPAGE = https://tvheadend.org/ LICENSE = GPL v3