Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add SF100Linux Formula #169771

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
62 changes: 62 additions & 0 deletions Formula/s/sf100linux.rb
@@ -0,0 +1,62 @@
class Sf100linux < Formula
desc "Linux software for Dediprog SF100 and SF600 SPI flash programmers"
homepage "https://github.com/DediProgSW/SF100Linux"
url "https://github.com/DediProgSW/SF100Linux/archive/refs/tags/V1.14.20.x.tar.gz"
sha256 "d3e710c2a4361b7a82e1fee6189e88a6a6ea149738c9cb95409f0a683e90366e"
license "GPL-2.0-or-later"

depends_on "libusb"
depends_on :macos
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why?

depends_on "pkg-config"

patch :DATA
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be submitted upstream


def install
system "make"
bin.install "dpcmd"
include.install "ChipInfoDb.dedicfg"
Comment on lines +16 to +17
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there no make install?

end

test do
system "#{bin}/dpcmd", "--check"
end
end

__END__
diff --git a/parse.c b/parse.c
index c9fe9db..462c2e8 100755
--- a/parse.c
+++ b/parse.c
@@ -19,27 +19,22 @@ FILE* openChipInfoDb(void)
{
FILE* fp = NULL;
char Path[linebufsize];
+ uint32_t size = sizeof(Path);

memset(Path, 0, linebufsize);
- if (readlink("/proc/self/exe", Path, 512) != -1) {
- dirname(Path);
+ if (_NSGetExecutablePath(Path, &size) == 0) {
+ strcpy(Path, dirname(Path));
strcat(Path, "/ChipInfoDb.dedicfg");
- // printf("%s\n",Path);
if ((fp = fopen(Path, "rt")) == NULL) {
// ChipInfoDb.dedicfg not in program directory
- dirname(Path);
- dirname(Path);
- strcat(Path, "/share/DediProg/ChipInfoDb.dedicfg");
- // printf("%s\n",Path);
+ strcpy(Path, dirname(Path));
+ strcpy(Path, dirname(Path));
+ strcat(Path, "/include/ChipInfoDb.dedicfg");
if ((fp = fopen(Path, "rt")) == NULL)
fprintf(stderr, "Error opening file: %s\n", Path);
}
}

- //xml_parse_result result = doc.load_file( Path );
- //if ( result.status != xml_parse_status::status_ok )
- // return;
-
return fp;
}