Skip to content

Commit b8035fa

Browse files
committed
unzip (windows)
1 parent 2dbe5dd commit b8035fa

File tree

3 files changed

+45
-4
lines changed

3 files changed

+45
-4
lines changed
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
@echo off
2+
setlocal
3+
4+
pkgx -q unzip %*
5+
if %ERRORLEVEL% NEQ 0 exit /b %ERRORLEVEL%
6+
7+
endlocal
8+
exit /b 0
Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,18 @@
11
import { BuildOptions, run, unarchive } from "brewkit";
22

3+
//TODO can link against zlib
4+
35
export default async function ({ prefix, version }: BuildOptions) {
46
const M = version.major;
5-
const Mm = `${M}${version.minor}`;
7+
const m = version.minor;
68
await unarchive(
7-
`https://cytranet.dl.sourceforge.net/project/infozip/UnZip ${version.major}.x (latest)/UnZip ${version.marketing}/unzip${version.major}${version.minor}.tar.gz`,
9+
`https://cytranet.dl.sourceforge.net/project/infozip/UnZip ${M}.x (latest)/UnZip ${M}.${m}/unzip${M}${m}.tar.gz`,
810
);
9-
run`make --file unix/Makefile --jobs ${navigator.hardwareConcurrency} macosx`;
10-
run`make prefix=${prefix} install`;
11+
if (Deno.build.os != 'windows') {
12+
run`make --file unix/Makefile --jobs ${navigator.hardwareConcurrency} macosx`;
13+
run`make --file unix/Makefile prefix=${prefix} install`;
14+
} else {
15+
run`nmake /f win32/Makefile prefix=${prefix}`;
16+
run`nmake /f win32/Makefile install prefix=${prefix}`;
17+
}
1118
}
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
diff --git i/win32/win32.c w/win32/win32.c
2+
index 410207f..60bfe05 100644
3+
--- i/win32/win32.c
4+
+++ w/win32/win32.c
5+
@@ -488,18 +488,11 @@ int test_NTSD(__G__ eb, eb_size, eb_ucptr, eb_ucsize)
6+
/* Function IsWinNT() */
7+
/**********************/
8+
9+
+#include <VersionHelpers.h>
10+
+
11+
int IsWinNT(void) /* returns TRUE if real NT, FALSE if Win9x or Win32s */
12+
{
13+
- static DWORD g_PlatformId = 0xFFFFFFFF; /* saved platform indicator */
14+
-
15+
- if (g_PlatformId == 0xFFFFFFFF) {
16+
- /* note: GetVersionEx() doesn't exist on WinNT 3.1 */
17+
- if (GetVersion() < 0x80000000)
18+
- g_PlatformId = TRUE;
19+
- else
20+
- g_PlatformId = FALSE;
21+
- }
22+
- return (int)g_PlatformId;
23+
+ return IsWindowsXPOrGreater();
24+
}
25+
26+

0 commit comments

Comments
 (0)