NotFlawffles / termux-nerd-installer

Termux tool to easily install nerd fonts
80 stars 3 forks source link

Something is Deprecated #8

Open dimassalim opened 1 week ago

dimassalim commented 1 week ago

I'm not sure if I'm missing dependency (again) or something is actually deprecated and the code need to be updated, but I hope below helps:

u0_a980@localhost ~/s/s/c/termux-nerd-installer> make install
make default
make[1]: Entering directory '/storage/emulated/0/code/termux-nerd-installer'
cc -Wall -Wextra -ggdb -o termux-nerd-installer src/fontinstaller.c src/main.c src/utils.c -lcurl -lm
src/fontinstaller.c:203:28: warning: 'CURLOPT_PROGRESSFUNCTION' is deprecated: since 7.32.0. Use CURLOPT_XFERINFOFUNCTION [-Wdeprecated-declarations]
  203 |     curl_easy_setopt(curl, CURLOPT_PROGRESSFUNCTION, download_progress);
      |                            ^
/data/data/com.termux/files/usr/include/curl/curl.h:1303:3: note: 'CURLOPT_PROGRESSFUNCTION' has been explicitly marked deprecated here
 1303 |   CURLOPTDEPRECATED(CURLOPT_PROGRESSFUNCTION, CURLOPTTYPE_FUNCTIONPOINT, 56,
      |   ^
/data/data/com.termux/files/usr/include/curl/curl.h:1090:43: note: expanded from macro 'CURLOPTDEPRECATED'
 1090 | #define CURLOPTDEPRECATED(na,t,nu,v,m) na CURL_DEPRECATED(v,m) = t + nu
      |                                           ^
/data/data/com.termux/files/usr/include/curl/curl.h:44:18: note: expanded from macro 'CURL_DEPRECATED'
   44 |   __attribute__((deprecated("since " # version ". " message)))
      |                  ^
1 warning generated.
make[1]: Leaving directory '/storage/emulated/0/code/termux-nerd-installer'
mv termux-nerd-installer /data/data/com.termux/files/usr/bin

Regarding dependency, does clang required for this to work? Before installing clang, make would hit me with [makefile:10: default] error 127 and [makefile:18: install] error 2

Thanks :)

bitcomrade commented 1 day ago

Hello. Had the same problem here. Open src/fontinstaller.c and change CURLOPT_PROGRESSFUNCTION to CURLOPT_XFERINFOFUNCTION Then make install

Edit: image

Also need to change all variables types from double to curl_off_t on line 135 because of new function. Or it will draw infinite progress bar on installing fonts. @dimassalim