From nobody Mon Jun 03 15:12:27 2024 X-Original-To: dev-commits-ports-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4VtHJt5xnQz5Mgj0; Mon, 03 Jun 2024 15:12:30 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4VtHJt3scPz4smX; Mon, 3 Jun 2024 15:12:29 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1717427550; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=iC7K+Y20Za+K5MZfK47ATbYDnTURgDGALkgt+3Jlbz4=; b=k6/VnqYe0HxDDHB+hvgxozlDR5UrY8sKpc4rOiCaTg7nIj2F14i5EBqiXi8PQUzm05IDbs ViZeiBi6tkRdys96JBDpdAMuk6LN+OUqm19Vtogb2FaUCfoQMkwNiWpzdkaU1fyp7Lc/sM Mgdoa0dEN3cWuAspXtXxEvYumahcu/GF+gffRmpA0C1vWZwUa8m8P1eX+/+yP+CMeG1Ljk SFS7TyeJnSDgpNDARAS2KoGohy4l7KPK3HhDWBMJBSCDOXuSTOcbG4O03qooUZYpmfVanY VACRPrgx1N90nkTeKoVXdNBm5+nXGFRuFS39aLo/MT+jcWBpxe7XM1788fSk7Q== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1717427550; a=rsa-sha256; cv=none; b=OPhgITnsL39TbuXQBDaMu4RBMMFAAY+HZtqJlHnoyFdO6djJIMqFORiIF8Gvqo6zqnJNm4 6PyA0bD/Qj6ML6chQwp5QMTNe5a1SmdUmBa8amWRGoDuiLJRkYeP5LHSQnJpadjCtLs4pI vA/BUKFa7tgfR9qIAbNtafKj4OsPVlMfWDWfU3HkStthvb/t1WApitCHlmPWTI3Ksz8KIs lABcCO9oTeyU2XZ6JvtPA/lbr6mD5Kw+CS70Rz0GYMkNvQWj6PqwkUT+1jw8v2RTPH8jOW 20tdsEs5dXz/bedUz/eYuVCuxB4i4PW7A2iWrYdUk3aLgeniOt39bZCzfik05w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1717427550; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=iC7K+Y20Za+K5MZfK47ATbYDnTURgDGALkgt+3Jlbz4=; b=DQLoKN/NsPxzRyFqe2059JwRfqAy2hesQqGf9Mj/fskp63Xy29CMo6V6iwB2A4ueKESdWV lTzCSXDmbLlXQiXIr0bPU49xfEKbcrVeAQfzZHXFiIFp08tI+chkmv8GiLNV9m5RP2odfI Z/maIanIXF1RHrb6Z892WbWf9zC4ctcb9R2UkeSYQcSzdKePWSPtjy7toX75ai7VJBtnHw 1aXV6ZjAPEBi+1VQy792Dz/UFFE1oXRwGrZE0ARf1jC91EskRHOgMvQyjkNqFRot/zu9/n zwVF3bdQrJYF8KfCzM0T0fi3w8Z7AEnC/SkNJs0SGE3fISHKYAVHLDQtbGYb2w== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4VtHJq6rGHzgZJ; Mon, 3 Jun 2024 15:12:27 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 453FCRTI042463; Mon, 3 Jun 2024 15:12:27 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 453FCRsC042460; Mon, 3 Jun 2024 15:12:27 GMT (envelope-from git) Date: Mon, 3 Jun 2024 15:12:27 GMT Message-Id: <202406031512.453FCRsC042460@gitrepo.freebsd.org> To: ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-main@FreeBSD.org From: Piotr Kubaj Subject: git: 37544c8ef61b - main - games/sdlpop: fix data directory patch List-Id: Commits to the main branch of the FreeBSD ports repository List-Archive: https://lists.freebsd.org/archives/dev-commits-ports-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-ports-main@freebsd.org Sender: owner-dev-commits-ports-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: pkubaj X-Git-Repository: ports X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 37544c8ef61bda6a3ab53a04d6fc28a9465e4c71 Auto-Submitted: auto-generated The branch main has been updated by pkubaj: URL: https://cgit.FreeBSD.org/ports/commit/?id=37544c8ef61bda6a3ab53a04d6fc28a9465e4c71 commit 37544c8ef61bda6a3ab53a04d6fc28a9465e4c71 Author: Viacheslav Chimishuk AuthorDate: 2024-05-27 10:15:02 +0000 Commit: Piotr Kubaj CommitDate: 2024-06-03 15:07:52 +0000 games/sdlpop: fix data directory patch After installing games/sdlpop from ports game cannot find its resources and shows next banner after start. ``` Cannot find a required data file: IBM_SND1.DAT or folder: data/IBM_SND1 Press any key to quit. ``` Proposed fix updates existing `files/patch-seg009.c` patch to fix the issue. PR: 279161 --- games/sdlpop/Makefile | 2 ++ games/sdlpop/files/patch-seg009.c | 25 +++++++++++++++++-------- 2 files changed, 19 insertions(+), 8 deletions(-) diff --git a/games/sdlpop/Makefile b/games/sdlpop/Makefile index 618c03814fe1..f38f88b5aca3 100644 --- a/games/sdlpop/Makefile +++ b/games/sdlpop/Makefile @@ -1,6 +1,7 @@ PORTNAME= sdlpop DISTVERSIONPREFIX= v DISTVERSION= 1.23 +PORTREVISION= 1 CATEGORIES= games MAINTAINER= pkubaj@FreeBSD.org @@ -31,6 +32,7 @@ DESKTOP_ENTRIES= "Prince" "Open-Source port of Prince of Persia" \ OPTIONS_DEFINE= DOCS post-patch: + @${REINPLACE_CMD} -e 's|%%DATADIR%%|${DATADIR}|' ${WRKSRC}/lighting.c @${REINPLACE_CMD} -e 's|%%DATADIR%%|${DATADIR}|' ${WRKSRC}/seg009.c do-install: diff --git a/games/sdlpop/files/patch-seg009.c b/games/sdlpop/files/patch-seg009.c index 1c6c504014a8..460c6df3b634 100644 --- a/games/sdlpop/files/patch-seg009.c +++ b/games/sdlpop/files/patch-seg009.c @@ -1,15 +1,24 @@ ---- seg009.c.orig 2021-07-06 13:10:16 UTC +--- seg009.c.orig 2023-02-04 09:43:22 UTC +++ seg009.c -@@ -343,7 +343,7 @@ static FILE* open_dat_from_root_or_data_dir(const char +@@ -340,7 +340,7 @@ static FILE* open_dat_from_root_or_data_dir(const char // if failed, try if the DAT file can be opened in the data/ directory, instead of the main folder if (fp == NULL) { char data_path[POP_MAX_PATH]; - snprintf_check(data_path, sizeof(data_path), "data/%s", filename); + snprintf_check(data_path, sizeof(data_path), "%%DATADIR%%/%s", filename); - if (!file_exists(data_path)) { - find_exe_dir(); -@@ -2078,7 +2078,7 @@ const int sound_channel = 0; + if (!file_exists(data_path)) { + find_exe_dir(); +@@ -411,7 +411,7 @@ dat_type* open_dat(const char* filename, int optional) + filename_no_ext[len-4] = '\0'; // terminate, so ".DAT" is deleted from the filename + } + char foldername[POP_MAX_PATH]; +- snprintf_check(foldername,sizeof(foldername),"data/%s",filename_no_ext); ++ snprintf_check(foldername,sizeof(foldername),"%%DATADIR%%/%s",filename_no_ext); + const char* data_path = locate_file(foldername); + struct stat path_stat; + int result = stat(data_path, &path_stat); +@@ -2120,7 +2120,7 @@ void load_sound_names() { const int max_sound_id = 58; void load_sound_names() { @@ -18,7 +27,7 @@ if (sound_names != NULL) return; FILE* fp = fopen(names_path,"rt"); if (fp==NULL) return; -@@ -2128,7 +2128,7 @@ sound_buffer_type* load_sound(int index) { +@@ -2170,7 +2170,7 @@ sound_buffer_type* load_sound(int index) { fp = fopen(filename, "rb"); } if (fp == NULL && !skip_normal_data_files) { @@ -27,7 +36,7 @@ fp = fopen(locate_file(filename), "rb"); } if (fp == NULL) { -@@ -2495,7 +2495,7 @@ void __pascal far set_gr_mode(byte grmode) { +@@ -2546,7 +2546,7 @@ void set_gr_mode(byte grmode) { #endif } @@ -36,7 +45,7 @@ if (icon == NULL) { sdlperror("set_gr_mode: Could not load icon"); } else { -@@ -2754,7 +2754,7 @@ void load_from_opendats_metadata(int resource_id, cons +@@ -2814,7 +2814,7 @@ void load_from_opendats_metadata(int resource_id, cons if (len >= 5 && filename_no_ext[len-4] == '.') { filename_no_ext[len-4] = '\0'; // terminate, so ".DAT" is deleted from the filename }