From 4bc4cb223909d72aa365deea726b88f79c4531ce Mon Sep 17 00:00:00 2001 From: dirkf Date: Thu, 5 Nov 2026 15:46:11 +0000 Subject: [PATCH] [build] Mild re-work of #33308 (#33309) * `YTDL_PYTHON`, if not empty, is the shebang string (following `#!`) * otherwise, the bilingual shebang header script is used * as originally, `PYTHON`, defaulting to `usr/bin/env python`, is used by _make_ to run build scripts. --- Makefile | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index a476f4e01..6b7a5848c 100644 --- a/Makefile +++ b/Makefile @@ -9,7 +9,8 @@ PREFIX ?= /usr/local BINDIR ?= $(PREFIX)/bin MANDIR ?= $(PREFIX)/man SHAREDIR ?= $(PREFIX)/share -PYTHON ?= +PYTHON ?= /usr/bin/env python +YTDL_PYTHON ?= # set SYSCONFDIR to /etc if PREFIX=/usr or PREFIX=/usr/local SYSCONFDIR = $(shell if [ $(PREFIX) = /usr -o $(PREFIX) = /usr/local ]; then echo /etc; else echo $(PREFIX)/etc; fi) @@ -67,7 +68,7 @@ youtube-dl: youtube_dl/*.py youtube_dl/*/*.py mv zip/youtube_dl/__main__.py zip/ cd zip && zip -q "../$@" youtube_dl/*.py youtube_dl/*/*.py __main__.py rm -rf zip - [ -n "$(PYTHON)" ] && > "$@" echo "#!$(PYTHON)" || > "$@" echo "#!/bin/sh\\n\ + [ -n "$(YTDL_PYTHON)" ] && > "$@" echo "#!$(YTDL_PYTHON)" || > "$@" echo "#!/bin/sh\\n\ ''':'\\n\ python=python3\\n\ command -v \"\$$python\" > /dev/null || python=python\\n\